report coverage in CI log #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: R-CMD-check | |
on: | |
push: | |
pull_request: | |
jobs: | |
R-CMD-check: | |
runs-on: ubuntu-latest | |
env: | |
R_LIBS_USER: /home/runner/work/_temp/Library | |
TZ: UTC | |
_R_CHECK_SYSTEM_CLOCK_: FALSE | |
NOT_CRAN: true | |
_R_CHECK_FORCE_SUGGESTS_: false | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' # Specify a version compatible with reticulate | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libharfbuzz-dev libfribidi-dev libfontconfig1-dev libpng-dev pandoc pandoc-citeproc | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install anndata | |
pip install numpy # Ensure numpy is available | |
env: | |
RETICULATE_PYTHON: /opt/hostedtoolcache/Python/3.8.10/x64/bin/python # Path to the Python executable | |
- name: Verify Python installation | |
run: | | |
which python | |
python --version | |
pip list | |
- name: Install Bioconductor packages | |
run: | | |
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") | |
BiocManager::install(c("SingleCellExperiment", "SummarizedExperiment", "S4Vectors")) | |
shell: Rscript {0} | |
- name: Install R package dependencies | |
run: | | |
install.packages('remotes') | |
install.packages('devtools') | |
remotes::install_deps(dependencies = TRUE) | |
shell: Rscript {0} | |
- name: Install package | |
run: | | |
remotes::install_local() | |
shell: Rscript {0} | |
- name: Test Debugging | |
run: | | |
devtools::test() | |
shell: Rscript {0} | |
- name: Check package | |
run: | | |
R CMD check --no-manual --as-cran . | |
shell: bash | |
- name: Test coverage | |
run: | | |
library(covr) | |
coverage <- package_coverage() | |
print(coverage) | |
report(coverage) | |
covr::codecov(token = Sys.getenv("CODECOV_TOKEN")) | |
shell: Rscript {0} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |