forked from loafle/openapi-generator-original
70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
name: Samples R clients
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- samples/client/petstore/R/**
|
|
- samples/client/petstore/R-httr2/**
|
|
- samples/client/petstore/R-httr2-wrapper/**
|
|
pull_request:
|
|
paths:
|
|
- samples/client/petstore/R/**
|
|
- samples/client/petstore/R-httr2/**
|
|
- samples/client/petstore/R-httr2-wrapper/**
|
|
jobs:
|
|
build:
|
|
name: Build R projects
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
sample:
|
|
# clients
|
|
- samples/client/petstore/R/
|
|
- samples/client/petstore/R-httr2/
|
|
- samples/client/petstore/R-httr2-wrapper/
|
|
services:
|
|
petstore-api:
|
|
image: swaggerapi/petstore
|
|
ports:
|
|
- 80:8080
|
|
env:
|
|
SWAGGER_HOST: http://petstore.swagger.io
|
|
SWAGGER_BASE_PATH: /v2
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Add hosts to /etc/hosts
|
|
run: |
|
|
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
|
|
- uses: r-lib/actions/setup-r@v2
|
|
with:
|
|
use-public-rspm: true
|
|
|
|
- name: Install devtools
|
|
run: install.packages("devtools")
|
|
shell: Rscript {0}
|
|
working-directory: ${{ matrix.sample }}
|
|
|
|
- name: Build
|
|
run: devtools::build()
|
|
shell: Rscript {0}
|
|
working-directory: ${{ matrix.sample }}
|
|
|
|
- uses: r-lib/actions/setup-r-dependencies@v2
|
|
with:
|
|
working-directory: ${{ matrix.sample }}
|
|
extra-packages: any::rcmdcheck
|
|
needs: check
|
|
|
|
- uses: r-lib/actions/check-r-package@v2
|
|
with:
|
|
working-directory: ${{ matrix.sample }}
|
|
upload-snapshots: true
|
|
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
|
|
error-on: '"error"'
|
|
|
|
- name: Install local package
|
|
run: R CMD INSTALL .
|
|
shell: bash # Ensure correct shell for command execution
|
|
working-directory: ${{ matrix.sample }}
|