diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 2e48acc..222eefe 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,3 +1,5 @@ +# 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: @@ -5,11 +7,12 @@ on: pull_request: branches: - master + name: test-coverage jobs: test-coverage: - runs-on: macOS-latest + runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} ENVIRONMENT: ${{ secrets.ENVIRONMENT }} @@ -18,10 +21,13 @@ jobs: SLACK_ICON_EMOJI: ${{ secrets.SLACK_ICON_EMOJI }} SLACK_INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_URL_PREFIX }} SLACK_USERNAME: ${{ secrets.SLACK_USERNAME }} + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - uses: r-lib/actions/setup-pandoc@v1 @@ -50,5 +56,25 @@ jobs: shell: Rscript {0} - name: Test coverage - run: covr::codecov(quiet = FALSE, function_exclusions = c("slackr_dev", "slackr_tex")) + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package"), + function_exclusions = c("slackr_dev", "slackr_tex") + ) 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