chore: add type checks for addCellMetadata()
#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: Dev Branch Checks | |
on: | |
push: | |
branches: [ "dev" ] | |
permissions: | |
contents: write | |
packages: read | |
jobs: | |
codecov: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/drieslab/ci-giottosuite/ci-env | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: Set up GitHub token for R | |
run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
- name: giotto-deps | |
run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) | |
shell: Rscript {0} | |
- name: catch R deps not in container | |
run: devtools::install_deps() | |
shell: Rscript {0} | |
- name: Build and install # needed for GiottoData install | |
run: | | |
R CMD build . --no-build-vignettes | |
R CMD INSTALL *.tar.gz | |
- name: Generate coverage report and upload | |
run: | | |
remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) | |
# Create and save HTML report | |
coverage_report <- covr::package_coverage( | |
type = c("tests", "examples", "vignettes"), | |
combine_types = TRUE, | |
quiet = TRUE, | |
clean = FALSE, | |
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") | |
) | |
covr::report(coverage_report, file = "coverage-report.html", browse = FALSE) | |
# Upload to Codecov | |
covr::codecov( | |
coverage = coverage_report, | |
branch = "dev", | |
quiet = FALSE | |
) | |
shell: Rscript {0} | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload coverage HTML report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage-report.html | |
retention-days: 30 | |
rcmdcheck: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/drieslab/ci-giottosuite/ci-env | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: Set up GitHub token for R | |
run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
- name: giotto-deps | |
run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) | |
shell: Rscript {0} | |
- name: catch R deps not in container | |
run: devtools::install_deps() | |
shell: Rscript {0} | |
- name: Check package | |
run: | | |
remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) | |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error") | |
shell: Rscript {0} | |
bioccheck: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/drieslab/ci-giottosuite/ci-env | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: Set up GitHub token for R | |
run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
- name: giotto-deps | |
run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) | |
shell: Rscript {0} | |
- name: catch R deps not in container | |
run: devtools::install_deps() | |
shell: Rscript {0} | |
- name: Build and install | |
run: | | |
R CMD build . --no-build-vignettes | |
R CMD INSTALL *.tar.gz | |
- name: Run BiocCheck # this is mainly formatting. No need for GiottoData | |
run: | | |
BiocCheck::BiocCheck() | |
shell: Rscript {0} | |
lintr: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
permissions: | |
contents: write | |
packages: read | |
actions: read | |
security-events: write | |
container: | |
image: ghcr.io/drieslab/ci-giottosuite/ci-env | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history and tags | |
- name: Set up GitHub token for R | |
run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
- name: catch R deps not in container | |
run: devtools::install_deps() | |
shell: Rscript {0} | |
- name: Run lintr | |
run: | | |
results <- lintr::lint_package( | |
".", | |
exclusions = list("tests", "vignettes", "pkgdown"), | |
linters = lintr::linters_with_defaults( | |
indentation_linter = lintr::indentation_linter(indent = 4L), | |
object_name_linter = lintr::object_name_linter(styles = c("camelCase", "symbols", "snake_case", "UPPERCASE")) | |
) | |
) | |
# Fix any invalid column numbers | |
for (i in seq_along(results)) { | |
if (!is.null(results[[i]]$column_number) && results[[i]]$column_number < 1) { | |
results[[i]]$column_number <- 1 | |
} | |
} | |
lintr::sarif_output(results, "lintr-results.sarif") | |
shell: Rscript {0} | |
continue-on-error: true | |
- name: Upload analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: lintr-results.sarif | |
wait-for-processing: true |