From e33f9bb78df3901fafefd74cc4ac97e45fc45698 Mon Sep 17 00:00:00 2001 From: mtwesley Date: Mon, 25 Nov 2024 12:04:34 -0500 Subject: [PATCH] more granular updates to workflow actions --- .github/workflows/R-CMD-check.yaml | 34 ++++++++++++++-------------- .github/workflows/test-coverage.yaml | 19 ++++++---------- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 92e1692..1050325 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -46,7 +46,16 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 - - name: Install Homebrew (macOS only) + - name: Install system dependencies (Linux only) + if: runner.os == 'Linux' + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::rcmdcheck + any::sessioninfo + any::remotes + + - name: Install Homebrew and qpdf (macOS only) if: runner.os == 'macOS' uses: Homebrew/actions/setup-homebrew@master @@ -69,28 +78,19 @@ jobs: - name: Install greta and dependencies shell: Rscript {0} run: | - install.packages("remotes", repos = "https://cloud.r-project.org") - install.packages("rcmdcheck", repos = "https://cloud.r-project.org") - install.packages("sessioninfo", repos = "https://cloud.r-project.org") + install.packages("greta", repos = c("https://greta-dev.r-universe.dev", "https://cloud.r-project.org")) library(greta) install_greta_deps(timeout = 120) - - name: Verify Greta Environment + - name: Verify Greta environment + shell: Rscript {0} run: | library(greta) greta::greta_sitrep() - shell: Rscript {0} - - name: Install package + deps - run: | - - remotes::install_local(dependencies = TRUE, force = TRUE) - - - name: R CMD check - run: rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check') + - uses: r-lib/actions/check-r-package@v2 + with: + args: '--no-manual --as-cran' - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) \ No newline at end of file + run: sessioninfo::session_info() \ No newline at end of file diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index f60be1e..0ac7579 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -6,13 +6,16 @@ on: name: test-coverage -permissions: read-all +permissions: + contents: read + actions: write jobs: test-coverage: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + RETICULATE_AUTOCONFIGURE: 'FALSE' steps: - uses: actions/checkout@v4 @@ -53,21 +56,13 @@ jobs: shell: Rscript {0} - 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: r-lib/actions/test-coverage@v2 + with: + type: covr - uses: codecov/codecov-action@v4 with: fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} - file: ./cobertura.xml - plugin: noop - disable_search: true token: ${{ secrets.CODECOV_TOKEN }} - name: Show testthat output