|
| 1 | +name: R CMD check |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - devel |
| 7 | + paths: |
| 8 | + - 'DESCRIPTION' |
| 9 | + - '**basic_checks.yml' |
| 10 | + workflow_dispatch: |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - devel |
| 14 | + |
| 15 | +env: |
| 16 | + cache-version: v1 |
| 17 | + |
| 18 | +jobs: |
| 19 | + r-build-and-check: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + container: bioconductor/bioconductor_docker:devel |
| 22 | + |
| 23 | + env: |
| 24 | + R_REMOTES_NO_ERRORS_FROM_WARNINGS: TRUE |
| 25 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Get Ubuntu Codename and Set CRAN URL |
| 29 | + run: | |
| 30 | + CODENAME=$(lsb_release -cs) |
| 31 | + echo "CRAN=https://packagemanager.posit.co/cran/__linux__/${CODENAME}/latest" >> "$GITHUB_ENV" |
| 32 | +
|
| 33 | + - name: Checkout Repository |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Query dependencies and update old packages |
| 37 | + run: | |
| 38 | + BiocManager::install(ask=FALSE) |
| 39 | + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
| 40 | + shell: Rscript {0} |
| 41 | + |
| 42 | + - name: Cache R packages |
| 43 | + if: runner.os != 'Windows' |
| 44 | + uses: actions/cache@v4 |
| 45 | + with: |
| 46 | + path: /usr/local/lib/R/site-library |
| 47 | + key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }} |
| 48 | + restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r- |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + run: | |
| 52 | + remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories()) |
| 53 | + remotes::install_cran(c("rcmdcheck", "covr")) |
| 54 | + BiocManager::install("BiocCheck") |
| 55 | + shell: Rscript {0} |
| 56 | + |
| 57 | + - name: Run rcmdcheck |
| 58 | + env: |
| 59 | + _R_CHECK_CRAN_INCOMING_REMOTE_: false |
| 60 | + run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check") |
| 61 | + shell: Rscript {0} |
| 62 | + |
| 63 | + - name: Run BiocCheck |
| 64 | + env: |
| 65 | + DISPLAY: ':99.0' |
| 66 | + run: | |
| 67 | + BiocCheck::BiocCheck( |
| 68 | + dir('check', 'tar\\.gz$', full.names = TRUE), |
| 69 | + `quit-with-status` = FALSE, |
| 70 | + `no-check-R-ver` = TRUE, |
| 71 | + `no-check-bioc-help` = TRUE |
| 72 | + ) |
| 73 | + shell: Rscript {0} |
0 commit comments