|
| 1 | +name: Pre-Release Checks |
| 2 | + |
| 3 | +on: |
| 4 | + # Trigger the workflow when a PR opened/updated against a release branch. |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - 'release/*' |
| 8 | + # Trigger the workflow when commits are pushed to a release branch. |
| 9 | + # Because they are protected branches this workflow is effectively triggered |
| 10 | + # by three events: |
| 11 | + # 1. When a release branch is initially created/pushed. |
| 12 | + # 2. When a PR against a release branch is opened/updated. |
| 13 | + # 3. When a PR against a release branch is merged. |
| 14 | + push: |
| 15 | + branches: |
| 16 | + - 'release/*' |
| 17 | + # Allow the workflow to be triggered manually. |
| 18 | + workflow_dispatch: |
| 19 | + |
| 20 | +jobs: |
| 21 | + # Run CRAN checks, for more details see https://github.com/r-lib/actions. |
| 22 | + check-package: |
| 23 | + # System dependencies for cannot be automatically resolved by |
| 24 | + # `r-lib/actions/setup-r@v2` for macos or windows - to avoid having to |
| 25 | + # maintain separate logic to infer and install system of those operating |
| 26 | + # systems we'll only run integration checks with the ubuntu |
| 27 | + runs-on: ubuntu-latest |
| 28 | + |
| 29 | + # Run checks with R-release, R-devel, and R-oldrelease. |
| 30 | + strategy: |
| 31 | + # Make sure each job runs independently. When `fail-fast` is true |
| 32 | + # (by default) all jobs in the matrix are cancelled as soon as one fails. |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + r-version: ['release', 'devel', 'oldrel'] |
| 36 | + |
| 37 | + # Override the default job name to display the current R version name in |
| 38 | + # parentheses (e.g. "check-package (R-release)"). |
| 39 | + name: "check-package (R-${{ matrix.r-version }})" |
| 40 | + |
| 41 | + steps: |
| 42 | + # Pull the latest changes from the repository down to the runner. |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v4 |
| 45 | + |
| 46 | + # Install R and any system dependencies. |
| 47 | + - name: Setup R |
| 48 | + uses: r-lib/actions/setup-r@v2 |
| 49 | + with: |
| 50 | + # Install the R version specified by the current strategy. |
| 51 | + r-version: ${{ matrix.r-version }} |
| 52 | + # Use pre-built binaries from Posit's public package manager to |
| 53 | + # speed up R dependency installation. |
| 54 | + use-public-rspm: true |
| 55 | + # Specify additional repositories to pull dependencies not |
| 56 | + # available on CRAN (i.e. `BPCells`). |
| 57 | + extra-repositories: 'https://bnprks.r-universe.dev' |
| 58 | + |
| 59 | + # Install R dependencies. |
| 60 | + - name: Install Dependencies |
| 61 | + uses: r-lib/actions/setup-r-dependencies@v2 |
| 62 | + with: |
| 63 | + extra-packages: |
| 64 | + any::rcmdcheck |
| 65 | + any::pkgdown |
| 66 | + # Installed packages are cached by default - force an upgrade to the |
| 67 | + # latest version of all dependencies. |
| 68 | + upgrade: 'TRUE' |
| 69 | + |
| 70 | + # Run CRAN checks - fails if any ERRORs or WARNINGs are raised in which |
| 71 | + # case the `rcmdcheck` output will be uploaded as an artifact. |
| 72 | + - name: Run Checks |
| 73 | + uses: r-lib/actions/check-r-package@v2 |
| 74 | + env: |
| 75 | + # Suppress NOTEs that are accepted by CRAN, see: |
| 76 | + # https://www.rdocumentation.org/packages/rcmdcheck/versions/1.4.0/topics/rcmdcheck |
| 77 | + _R_CHECK_PKG_SIZES_: false |
| 78 | + _R_CHECK_RD_XREFS_: false |
| 79 | + _R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_: false |
| 80 | + _R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_: true |
0 commit comments