From 389c5b1c9aad620ff25be6208057f4f335b67484 Mon Sep 17 00:00:00 2001 From: Daniel Falster Date: Thu, 3 Aug 2023 11:21:11 +1000 Subject: [PATCH 1/3] Add windows into CI --- .github/workflows/r.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index d6096f25..4c3fa907 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -26,10 +26,12 @@ jobs: matrix: config: - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'release'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true steps: - uses: actions/checkout@v3 From 7ba6a302e918c126f1cc2ceacb9c537318470e19 Mon Sep 17 00:00:00 2001 From: Daniel Falster Date: Thu, 3 Aug 2023 14:29:04 +1000 Subject: [PATCH 2/3] Seperate out code coverage, add ubuntu --- .github/workflows/{r.yml => R-CMD-check.yml} | 26 ++-------- .github/workflows/test-coverage.yaml | 50 +++++++++++++++++++ 2 files changed, 54 insertions(+), 22 deletions(-) rename .github/workflows/{r.yml => R-CMD-check.yml} (68%) create mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/workflows/r.yml b/.github/workflows/ R-CMD-check.yml similarity index 68% rename from .github/workflows/r.yml rename to .github/workflows/ R-CMD-check.yml index 4c3fa907..c5ed88b8 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/ R-CMD-check.yml @@ -6,7 +6,7 @@ # See https://github.com/r-lib/actions/tree/master/examples#readme for # additional example workflows available for the R community. -name: R +name: R-CMD-check on: push: @@ -27,6 +27,7 @@ jobs: config: - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'release'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -46,30 +47,11 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: + cache-version: 3 extra-packages: local::., any::rcmdcheck, any::remotes, any::covr needs: check - name: Check uses: r-lib/actions/check-r-package@v2 with: - args: 'c("--no-manual", "--as-cran")' - error-on: '"error"' - check-dir: '"check"' - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check - - - name: Test coverage - run: | - library(traits.build) - covr::codecov(quiet=FALSE, type = "all") - shell: Rscript {0} + upload-snapshots: true diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 00000000..2c5bb502 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,50 @@ +# 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 + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - 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 + needs: coverage + + - name: Test coverage + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + shell: Rscript {0} + + - 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@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package From 6cd8293927c895194c36da73b1b0156d0442ae33 Mon Sep 17 00:00:00 2001 From: Daniel Falster Date: Thu, 3 Aug 2023 14:41:14 +1000 Subject: [PATCH 3/3] Further tweaking --- .github/workflows/{ R-CMD-check.yml => R-CMD-check.yml} | 5 ++++- .github/workflows/test-coverage.yaml | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) rename .github/workflows/{ R-CMD-check.yml => R-CMD-check.yml} (92%) diff --git a/.github/workflows/ R-CMD-check.yml b/.github/workflows/R-CMD-check.yml similarity index 92% rename from .github/workflows/ R-CMD-check.yml rename to .github/workflows/R-CMD-check.yml index c5ed88b8..55373fc5 100644 --- a/.github/workflows/ R-CMD-check.yml +++ b/.github/workflows/R-CMD-check.yml @@ -48,10 +48,13 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: cache-version: 3 - extra-packages: local::., any::rcmdcheck, any::remotes, any::covr + extra-packages: local::., any::rcmdcheck, any::remotes needs: check - name: Check uses: r-lib/actions/check-r-package@v2 with: + args: 'c("--no-manual", "--as-cran")' + error-on: '"error"' + check-dir: '"check"' upload-snapshots: true diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 2c5bb502..774a63ba 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -2,9 +2,7 @@ # 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] + branches: [develop] name: test-coverage