ci: push and PR should be checked #18
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: Dev Branch Checks | |
on: | |
push: | |
branches: [ "dev" ] | |
permissions: | |
contents: write | |
packages: read | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
container_name: ${{ steps.set-name.outputs.name }} | |
steps: | |
- name: Set container name | |
id: set-name | |
run: | | |
LOWER_NAME=$(echo "${{ github.repository }}" | awk '{print tolower($0)}') | |
echo "name=ghcr.io/${LOWER_NAME}/r-env:latest" >> $GITHUB_OUTPUT | |
codecov: | |
needs: setup | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.container_name }} | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: Debug Python environment | |
shell: Rscript {0} | |
run: | | |
print("Checking miniconda location:") | |
print(list.files("~/.local/share", recursive = FALSE)) | |
print(Sys.getenv("HOME")) | |
print("R lib path:") | |
print(.libPaths()) | |
print("Available conda environments:") | |
print(reticulate::conda_list()) | |
print("\nPython configuration:") | |
print(reticulate::py_config()) | |
print("\nChecking r-reticulate specifically:") | |
print(file.exists("/root/.local/share/r-miniconda/envs/r-reticulate")) | |
if(file.exists("/root/.local/share/r-miniconda/envs/r-reticulate")) { | |
print(list.files("/root/.local/share/r-miniconda/envs/r-reticulate", recursive = TRUE)) | |
} | |
- name: catch R deps not in container | |
run: devtools::install_deps() | |
shell: Rscript {0} | |
- name: Generate coverage report | |
run: | | |
covr::codecov( | |
quiet = FALSE, | |
clean = FALSE, | |
type = c("tests", "examples", "vignettes"), | |
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") | |
) | |
shell: Rscript {0} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false | |
flags: unittests | |
verbose: true | |
rcmdcheck: | |
needs: setup | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.container_name }} | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: catch R deps not in container | |
run: devtools::install_deps() | |
shell: Rscript {0} | |
- name: Check package | |
run: | | |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error") | |
shell: Rscript {0} | |
bioccheck: | |
needs: setup | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.container_name }} | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: catch R deps not in container | |
run: devtools::install_deps() | |
shell: Rscript {0} | |
- name: Build and install | |
run: | | |
R CMD build . | |
R CMD INSTALL *.tar.gz | |
- name: Run BiocCheck | |
run: | | |
BiocCheck::BiocCheck() | |
shell: Rscript {0} |