|
| 1 | +name: Release R CMD check and build site |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - RELEASE_3_20 |
| 8 | + paths: |
| 9 | + - 'DESCRIPTION' |
| 10 | + - '**.yml' |
| 11 | + |
| 12 | +env: |
| 13 | + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 14 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 15 | + CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest |
| 16 | + BIOC_VERSION: RELEASE_3_20 |
| 17 | + |
| 18 | +jobs: |
| 19 | + checkRelease: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + bioc_version: [RELEASE_3_20] # Define versions as matrix variables |
| 24 | + container: bioconductor/bioconductor_docker:${{ matrix.bioc_version }} |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Checkout Repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + ref: ${{ env.BIOC_VERSION }} |
| 31 | + |
| 32 | + - name: Query dependencies |
| 33 | + run: | |
| 34 | + BiocManager::install("remotes") |
| 35 | + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
| 36 | + shell: Rscript {0} |
| 37 | + |
| 38 | + - name: Cache R packages |
| 39 | + if: runner.os != 'Windows' |
| 40 | + uses: actions/cache@v4 |
| 41 | + with: |
| 42 | + path: /usr/local/lib/R/site-library |
| 43 | + key: ${{ runner.os }}-r-${{ env.BIOC_VERSION }}-${{ hashFiles('.github/depends.Rds') }} |
| 44 | + restore-keys: ${{ runner.os }}-r-${{ env.BIOC_VERSION }}- |
| 45 | + |
| 46 | + - name: Install Dependencies |
| 47 | + run: | |
| 48 | + remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories()) |
| 49 | + BiocManager::install(c("rcmdcheck", "pkgdown", "covr"), ask = FALSE, update = TRUE) |
| 50 | + shell: Rscript {0} |
| 51 | + |
| 52 | + - name: Check Package |
| 53 | + id: rcmdcheck |
| 54 | + env: |
| 55 | + _R_CHECK_CRAN_INCOMING_REMOTE_: false |
| 56 | + run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error", check_dir = "check") |
| 57 | + shell: Rscript {0} |
| 58 | + |
| 59 | + - name: Test coverage |
| 60 | + run: | |
| 61 | + covr::codecov( |
| 62 | + quiet = FALSE, |
| 63 | + clean = FALSE, |
| 64 | + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") |
| 65 | + ) |
| 66 | + shell: Rscript {0} |
| 67 | + |
| 68 | + - name: Build pkgdown |
| 69 | + run: | |
| 70 | + PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site()' |
| 71 | +
|
| 72 | + - name: Upload pkgdown artifact |
| 73 | + uses: actions/upload-pages-artifact@v3 |
| 74 | + with: |
| 75 | + path: docs |
| 76 | + |
| 77 | + deploy: |
| 78 | + needs: checkRelease |
| 79 | + permissions: |
| 80 | + contents: write |
| 81 | + pages: write |
| 82 | + id-token: write |
| 83 | + runs-on: ubuntu-latest |
| 84 | + |
| 85 | + steps: |
| 86 | + - name: Deploy to GitHub Pages |
| 87 | + id: deployment |
| 88 | + uses: actions/deploy-pages@v4 |
0 commit comments