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