diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 6ea2e57..bfd708d 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,3 +1,5 @@ +# Calls the shared CTTIR workflow. Do not add steps here - change the +# shared one at CTTIR/.github so every package moves together. on: push: branches: [main, master] @@ -10,73 +12,4 @@ permissions: read-all jobs: R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - # oldrel-3 covers the R version DESCRIPTION actually claims to - # support. Without it, code using base-R features newer than the - # declared minimum (e.g. `%||%`, added in R 4.4.0) is never built - # on a version where it fails. - - {os: ubuntu-latest, r: 'oldrel-3'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - _R_CHECK_FORCE_SUGGESTS_: false - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - extra-repositories: https://cttir.r-universe.dev - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - name: Install Bioconductor Suggests (optional) - run: | - if (!requireNamespace("BiocManager", quietly = TRUE)) - install.packages("BiocManager") - bioc_pkgs <- c("DESeq2", "edgeR", "limma", "ShortRead", "Biostrings", - "Rsamtools", "GenomicAlignments", "GenomicFeatures", - "GenomicRanges", "SummarizedExperiment", "Biobase", - "ComplexHeatmap", "EBImage", "SpatialExperiment", - "S4Vectors", "SingleCellExperiment") - desc_suggests <- strsplit(read.dcf("DESCRIPTION")[, "Suggests"], ",\\s*")[[1]] - desc_suggests <- trimws(gsub("\\s*\\(.*\\)", "", desc_suggests)) - to_install <- intersect(bioc_pkgs, desc_suggests) - if (length(to_install) > 0) { - message("Installing Bioconductor packages: ", paste(to_install, collapse = ", ")) - tryCatch( - BiocManager::install(to_install, update = FALSE), - error = function(e) message("Bioconductor install skipped: ", e$message) - ) - } else { - message("No Bioconductor Suggests found - skipping.") - } - shell: Rscript {0} - continue-on-error: true - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true - args: 'c("--no-manual", "--as-cran")' - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + uses: CTTIR/.github/.github/workflows/R-CMD-check.yaml@main diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..c1ccbce --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,16 @@ +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: lint + +permissions: read-all + +jobs: + lint: + uses: CTTIR/.github/.github/workflows/lint.yaml@main + with: + # Report-only until this package house-linter count reaches zero. + blocking: false diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index a04bbdd..bb19507 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,60 +1,19 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] pull_request: + branches: [main, master] -name: test-coverage.yaml +name: test-coverage permissions: read-all jobs: test-coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::covr, any::xml2 - needs: coverage - - - name: Test coverage - run: | - cov <- covr::package_coverage( - quiet = FALSE, - clean = FALSE, - install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") - ) - covr::to_cobertura(cov) - shell: Rscript {0} - - - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: false - file: ./cobertura.xml - plugin: noop - disable_search: true - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload test results - if: failure() - uses: actions/upload-artifact@v4 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package + uses: CTTIR/.github/.github/workflows/test-coverage.yaml@main + with: + # Report-only for now. The shared workflow computes coverage with covr + # and an explicit exit rather than delegating the gate to Codecov; + # set a real floor once this package is re-baselined. + floor: 0 + secrets: inherit