Skip to content

Commit

Permalink
GHA: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Dec 30, 2024
1 parent d65e465 commit 72e86a4
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 85 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- {os: ubuntu-latest, r: 'oldrel' }
- {os: ubuntu-latest, r: 'oldrel-1' }
- {os: ubuntu-latest, r: 'oldrel-2' }
- {os: ubuntu-latest, r: '3.4' }
- {os: ubuntu-latest, r: '4.0' }
- {os: windows-latest, r: 'release' , prune_functions: true, label: 'prune' }
- {os: macOS-latest, r: 'release' , prune_functions: true, label: 'prune' }
- {os: ubuntu-latest, r: 'devel' , prune_functions: true, label: 'prune' }
Expand All @@ -50,7 +50,7 @@ jobs:
R_FUTURE_GLOBALS_KEEPWHERE: ${{ matrix.config.globals_keepWhere }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
82 changes: 0 additions & 82 deletions .github/workflows/covr.yaml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on: [push]

name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- name: Assert CODECOV_TOKEN is set
run: |
if [[ -z "${{secrets.CODECOV_TOKEN}}" ]]; then
>&2 echo "::error::ERROR: 'secrets.CODECOV_TOKEN' not set"
exit 1
fi
- 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")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- 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: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

0 comments on commit 72e86a4

Please sign in to comment.