|
| 1 | +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples |
| 2 | +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + os_choice: |
| 10 | + description: 'Operating system to run on' |
| 11 | + required: true |
| 12 | + default: 'all' |
| 13 | + type: choice |
| 14 | + options: |
| 15 | + - all |
| 16 | + - ubuntu |
| 17 | + - macos |
| 18 | + - windows |
| 19 | + |
| 20 | +name: R-CMD-check.yaml |
| 21 | + |
| 22 | +permissions: read-all |
| 23 | + |
| 24 | +jobs: |
| 25 | + setup-matrix: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + outputs: |
| 28 | + matrix: ${{ steps.setup-matrix.outputs.matrix }} |
| 29 | + steps: |
| 30 | + - id: setup-matrix |
| 31 | + run: | |
| 32 | + if [[ "${{ github.event_name }}" == "push" || "${{ github.event.inputs.os_choice }}" == "all" ]]; then |
| 33 | + echo 'matrix={"config":[{"os":"macos-latest","r":"release"},{"os":"windows-latest","r":"release"},{"os":"ubuntu-latest","r":"release"}]}' >> $GITHUB_OUTPUT |
| 34 | + elif [[ "${{ github.event.inputs.os_choice }}" == "ubuntu" ]]; then |
| 35 | + echo 'matrix={"config":[{"os":"ubuntu-latest","r":"release"}]}' >> $GITHUB_OUTPUT |
| 36 | + elif [[ "${{ github.event.inputs.os_choice }}" == "macos" ]]; then |
| 37 | + echo 'matrix={"config":[{"os":"macos-latest","r":"release"}]}' >> $GITHUB_OUTPUT |
| 38 | + elif [[ "${{ github.event.inputs.os_choice }}" == "windows" ]]; then |
| 39 | + echo 'matrix={"config":[{"os":"windows-latest","r":"release"}]}' >> $GITHUB_OUTPUT |
| 40 | + fi |
| 41 | +
|
| 42 | + R-CMD-check: |
| 43 | + needs: setup-matrix |
| 44 | + runs-on: ${{ matrix.config.os }} |
| 45 | + |
| 46 | + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) |
| 47 | + |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} |
| 51 | + |
| 52 | + env: |
| 53 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + R_KEEP_PKG_SOURCE: yes |
| 55 | + |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - uses: r-lib/actions/setup-pandoc@v2 |
| 60 | + |
| 61 | + - uses: r-lib/actions/setup-r@v2 |
| 62 | + with: |
| 63 | + r-version: ${{ matrix.config.r }} |
| 64 | + http-user-agent: ${{ matrix.config.http-user-agent }} |
| 65 | + use-public-rspm: true |
| 66 | + |
| 67 | + - uses: r-lib/actions/setup-r-dependencies@v2 |
| 68 | + with: |
| 69 | + extra-packages: any::rcmdcheck |
| 70 | + needs: check |
| 71 | + |
| 72 | + - uses: r-lib/actions/check-r-package@v2 |
| 73 | + with: |
| 74 | + upload-snapshots: true |
| 75 | + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' |
0 commit comments