Skip to content

Commit 5d55272

Browse files
authored
Modify test-coverage.yaml for coverage report upload
Updated the test coverage workflow to build and upload coverage reports to Codecov.
1 parent a53454f commit 5d55272

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: macOS-latest
1414
env:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
16+
1717
steps:
1818
- uses: actions/checkout@v3
1919

@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Query dependencies
2525
run: |
26-
install.packages('remotes')
26+
install.packages("remotes")
2727
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
2828
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
2929
shell: Rscript {0}
@@ -37,13 +37,25 @@ jobs:
3737

3838
- name: Install dependencies
3939
run: |
40-
install.packages(c("remotes"))
40+
install.packages("remotes")
4141
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
4242
BiocManager::install("phyloseq", ask = FALSE)
4343
remotes::install_deps(dependencies = TRUE)
4444
remotes::install_cran("covr")
45+
install.packages("xml2")
4546
shell: Rscript {0}
4647

47-
- name: Test coverage
48-
run: covr::codecov()
48+
- name: Build coverage report
49+
run: |
50+
cov <- covr::package_coverage()
51+
print(cov)
52+
covr::to_cobertura(cov, filename = "coverage.xml")
4953
shell: Rscript {0}
54+
55+
- name: Upload coverage reports to Codecov
56+
uses: codecov/codecov-action@v5
57+
with:
58+
token: ${{ secrets.CODECOV_TOKEN_tinyvamp }}
59+
files: coverage.xml
60+
slug: statdivlab/tinyvamp
61+
fail_ci_if_error: true

0 commit comments

Comments
 (0)