|
1 | | -name: Devel PR CMD check |
| 1 | +name: PR CMD check & build site |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
| 5 | + push: |
| 6 | + paths: |
| 7 | + - 'DESCRIPTION' |
| 8 | + - '**.yml' |
5 | 9 | branches: |
6 | 10 | - devel |
| 11 | + - RELEASE_3_21 |
| 12 | + |
| 13 | +env: |
| 14 | + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 15 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 16 | + CRAN: https://p3m.dev/cran/__linux__/noble/latest |
| 17 | + BIOC_RELEASE: RELEASE_3_21 |
7 | 18 |
|
8 | 19 | jobs: |
9 | | - checkDevel: |
10 | | - runs-on: ubuntu-22.04 |
11 | | - container: bioconductor/bioconductor_docker:devel |
| 20 | + set-matrix: |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + outputs: |
| 23 | + matrix: ${{ steps.set.outputs.matrix }} |
| 24 | + steps: |
| 25 | + - name: Set Matrix Bioconductor Version |
| 26 | + id: set |
| 27 | + run: | |
| 28 | + MATRIX="{\"include\":[{\"bioc_version\":\"$GITHUB_REF_NAME\"}]}" |
| 29 | + echo "matrix=$MATRIX" >> $GITHUB_OUTPUT |
12 | 30 |
|
13 | | - env: |
14 | | - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
15 | | - CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest |
16 | | - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + check: |
| 32 | + needs: set-matrix |
| 33 | + runs-on: ubuntu-latest |
| 34 | + strategy: |
| 35 | + matrix: ${{ fromJson(needs.set-matrix.outputs.matrix) }} |
| 36 | + container: bioconductor/bioconductor_docker:${{ matrix.bioc_version }} |
17 | 37 |
|
18 | 38 | steps: |
19 | 39 | - name: Checkout Repository |
20 | | - uses: actions/checkout@v3 |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + ref: ${{ matrix.bioc_version }} |
21 | 43 |
|
22 | 44 | - name: Query dependencies |
23 | 45 | run: | |
24 | | - BiocManager::install("remotes") |
| 46 | + BiocManager::install(c("covr", "BiocCheck")) |
25 | 47 | saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
26 | 48 | shell: Rscript {0} |
27 | 49 |
|
28 | 50 | - name: Cache R packages |
29 | 51 | if: runner.os != 'Windows' |
30 | | - uses: actions/cache@v1 |
| 52 | + uses: actions/cache@v4 |
31 | 53 | with: |
32 | 54 | path: /usr/local/lib/R/site-library |
33 | | - key: ${{ runner.os }}-r-1-${{ hashFiles('.github/depends.Rds') }} |
34 | | - restore-keys: ${{ runner.os }}-r-1- |
| 55 | + key: ${{ runner.os }}-r-${{ matrix.bioc_version }}-${{ hashFiles('.github/depends.Rds') }} |
| 56 | + restore-keys: ${{ runner.os }}-r-${{ matrix.bioc_version }}- |
| 57 | + |
| 58 | + - name: Install GPG |
| 59 | + if: ${{ github.ref == 'refs/heads/devel' && github.event_name != 'pull_request' }} |
| 60 | + run: sudo apt-get update && sudo apt-get install -y gpg |
35 | 61 |
|
36 | 62 | - name: Install Dependencies |
37 | 63 | run: | |
|
45 | 71 | run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error", check_dir = "check") |
46 | 72 | shell: Rscript {0} |
47 | 73 |
|
| 74 | + - name: Test coverage |
| 75 | + if: ${{ success() && github.ref == 'refs/heads/devel' && github.event_name != 'pull_request' }} |
| 76 | + run: | |
| 77 | + cov <- covr::package_coverage( |
| 78 | + quiet = FALSE, |
| 79 | + clean = FALSE, |
| 80 | + type = "all", |
| 81 | + install_path = file.path( |
| 82 | + normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), |
| 83 | + "package" |
| 84 | + ) |
| 85 | + ) |
| 86 | + covr::to_cobertura(cov) |
| 87 | + shell: Rscript {0} |
| 88 | + |
| 89 | + - name: Upload test results to Codecov |
| 90 | + if: ${{ success() && github.ref == 'refs/heads/devel' && github.event_name != 'pull_request' }} |
| 91 | + uses: codecov/codecov-action@v4 |
| 92 | + with: |
| 93 | + fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} |
| 94 | + file: ./cobertura.xml |
| 95 | + plugin: noop |
| 96 | + disable_search: true |
| 97 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 98 | + |
48 | 99 | - name: Run BiocCheck |
| 100 | + id: bioccheck |
49 | 101 | run: | |
50 | | - BiocCheck::BiocCheck() |
| 102 | + BiocCheck::BiocCheck( |
| 103 | + dir('check', 'tar.gz$', full.names = TRUE), |
| 104 | + `quit-with-status` = TRUE, `no-check-bioc-help` = TRUE |
| 105 | + ) |
51 | 106 | shell: Rscript {0} |
52 | 107 |
|
| 108 | + - name: Build pkgdown |
| 109 | + if: ${{ github.ref == format('refs/heads/{0}', env.BIOC_RELEASE) && github.event_name != 'pull_request' }} |
| 110 | + run: | |
| 111 | + PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site()' |
| 112 | +
|
| 113 | + - name: Upload pkgdown artifact |
| 114 | + if: github.ref == format('refs/heads/{0}', env.BIOC_RELEASE) |
| 115 | + uses: actions/upload-pages-artifact@v3 |
| 116 | + with: |
| 117 | + path: docs |
| 118 | + |
| 119 | + deploy: |
| 120 | + needs: check |
| 121 | + permissions: |
| 122 | + contents: write |
| 123 | + pages: write |
| 124 | + id-token: write |
| 125 | + runs-on: ubuntu-24.04 |
| 126 | + |
| 127 | + steps: |
| 128 | + - name: Deploy to GitHub Pages |
| 129 | + if: ${{ github.ref == format('refs/heads/{0}', env.BIOC_RELEASE) && github.event_name != 'pull_request' }} |
| 130 | + id: deployment |
| 131 | + uses: actions/deploy-pages@v4 |
0 commit comments