Skip to content

Commit a831b9e

Browse files
committed
update GHA pr_check.yml
1 parent 0ed693d commit a831b9e

File tree

2 files changed

+96
-80
lines changed

2 files changed

+96
-80
lines changed

.github/workflows/pr_check.yml

Lines changed: 96 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
1-
name: Devel PR CMD check
1+
name: PR CMD check & build site
22

33
on:
4-
push:
5-
branches-ignore:
6-
- devel
7-
- RELEASE_3_*
84
pull_request:
5+
push:
6+
paths:
7+
- 'DESCRIPTION'
8+
- '**.yml'
99
branches:
1010
- devel
11+
- RELEASE_3_21
1112

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
2018

19+
jobs:
20+
set-matrix:
21+
runs-on: ubuntu-24.04
22+
outputs:
23+
matrix: ${{ steps.set.outputs.matrix }}
2124
steps:
22-
- name: Get Ubuntu Codename and Set CRAN URL
25+
- name: Set Matrix Bioconductor Version
26+
id: set
2327
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 }}
2637

38+
steps:
2739
- name: Checkout Repository
2840
uses: actions/checkout@v4
41+
with:
42+
ref: ${{ matrix.bioc_version }}
2943

3044
- name: Query dependencies
3145
run: |
32-
BiocManager::install("remotes")
46+
BiocManager::install(c("covr", "BiocCheck"))
3347
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
3448
shell: Rscript {0}
3549

@@ -38,8 +52,11 @@ jobs:
3852
uses: actions/cache@v4
3953
with:
4054
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
4360

4461
- name: Install Dependencies
4562
run: |
@@ -50,5 +67,64 @@ jobs:
5067
- name: Check Package
5168
env:
5269
_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)
5486
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

.github/workflows/test-coverage.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)