|
| 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: System dependencies |
| 53 | + run: | |
| 54 | + pip install ghp-import |
| 55 | +
|
| 56 | + - name: Check Package |
| 57 | + id: rcmdcheck |
| 58 | + env: |
| 59 | + _R_CHECK_CRAN_INCOMING_REMOTE_: false |
| 60 | + run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "error", check_dir = "check") |
| 61 | + shell: Rscript {0} |
| 62 | + |
| 63 | + - name: Test coverage |
| 64 | + run: | |
| 65 | + covr::codecov( |
| 66 | + quiet = FALSE, |
| 67 | + clean = FALSE, |
| 68 | + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") |
| 69 | + ) |
| 70 | + shell: Rscript {0} |
| 71 | + |
| 72 | + - name: Build pkgdown |
| 73 | + run: | |
| 74 | + PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site()' |
| 75 | +
|
| 76 | + - name: Install deploy dependencies |
| 77 | + run: | |
| 78 | + apt-get update |
| 79 | + apt-get -y install rsync |
| 80 | +
|
| 81 | + - name: Deploy 🚀 |
| 82 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 83 | + with: |
| 84 | + TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + BRANCH: gh-pages # The branch the action should deploy to. |
| 86 | + FOLDER: docs # The folder the action should deploy. |
| 87 | + |
0 commit comments