From 37a7d2e119b6a7e52549b01305373dc23d5231c0 Mon Sep 17 00:00:00 2001 From: pkg-skeleton Deploy Bot <@github.com> Date: Sun, 23 Apr 2023 20:43:06 +0000 Subject: [PATCH] Automated file update from pkg-skeleton --- .github/workflows/test-coverage.yaml | 54 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 3999ebc..573fdf6 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -28,48 +28,50 @@ name: Test coverage jobs: test-coverage: - runs-on: macOS-latest - + runs-on: ubuntu-latest env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v3 - uses: r-lib/actions/setup-r@v2 - - - uses: r-lib/actions/setup-pandoc@v2 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v1 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + use-public-rspm: true + extra-repositories: "https://r-hyperspec.github.io/pkg-repo/" - - name: Install dependencies - run: | - install.packages(c("remotes", "devtools")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - shell: Rscript {0} + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr, any::devtools, any::roxygen2 + needs: coverage - name: Roxygenize + shell: Rscript {0} run: | # Vignettes are not needed for coverage tests roclets <- roxygen2::load_options()$roclets roclets <- roclets[!roclets %in% "vignette"] devtools::document(roclets = roclets) - shell: Rscript {0} - name: Test coverage - run: covr::codecov() shell: Rscript {0} + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + + - name: Show testthat output + shell: bash + if: always() + run: | + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package