|
| 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 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + package_name: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + |
| 10 | +name: Build and check an R package |
| 11 | + |
| 12 | +permissions: read-all |
| 13 | + |
| 14 | +jobs: |
| 15 | + R-CMD-check: |
| 16 | + runs-on: ${{ matrix.config.os }} |
| 17 | + |
| 18 | + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) |
| 19 | + |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + config: |
| 24 | + # The vignette requires X11, but I wasn't able to get X11 in the MacOS config, so disable for now. |
| 25 | + #- {os: macos-latest, r: 'release'} |
| 26 | + # doesn't work because we use gunzip |
| 27 | + #- {os: windows-latest, r: 'release'} |
| 28 | + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} |
| 29 | + - {os: ubuntu-latest, r: 'release'} |
| 30 | + |
| 31 | + env: |
| 32 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + R_KEEP_PKG_SOURCE: yes |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + |
| 38 | + # ChatGPT suggested the following macOS steps to address libXrender.1.dylib not found |
| 39 | + #- name: Install XQuartz (macOS only) |
| 40 | + # if: runner.os == 'macOS' |
| 41 | + # run: brew install --cask xquartz |
| 42 | + |
| 43 | + #- name: Set Library Path (macOS only) |
| 44 | + # if: runner.os == 'macOS' |
| 45 | + # run: echo "DYLD_LIBRARY_PATH=/opt/X11/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV |
| 46 | + |
| 47 | + - uses: r-lib/actions/setup-pandoc@v2 |
| 48 | + |
| 49 | + - uses: r-lib/actions/setup-r@v2 |
| 50 | + with: |
| 51 | + r-version: ${{ matrix.config.r }} |
| 52 | + http-user-agent: ${{ matrix.config.http-user-agent }} |
| 53 | + use-public-rspm: true |
| 54 | + |
| 55 | + - uses: r-lib/actions/setup-r-dependencies@v2 |
| 56 | + with: |
| 57 | + working-directory: R/${{ inputs.package_name }} |
| 58 | + extra-packages: any::rcmdcheck,testthat |
| 59 | + needs: check |
| 60 | + dependencies: '"hard"' |
| 61 | + |
| 62 | + - uses: r-lib/actions/check-r-package@v2 |
| 63 | + with: |
| 64 | + working-directory: R/${{ inputs.package_name }} |
| 65 | + upload-snapshots: true |
| 66 | + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' |
0 commit comments