Skip to content

Commit

Permalink
Add windows & ubuntu into CI (#33)
Browse files Browse the repository at this point in the history
* rename tests
* Seperate out code coverage onto different workflow
  • Loading branch information
dfalster authored Aug 3, 2023
1 parent 9009554 commit 04ed03e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 20 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/r.yml → .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -26,10 +26,13 @@ jobs:
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-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
Expand All @@ -44,7 +47,8 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::., any::rcmdcheck, any::remotes, any::covr
cache-version: 3
extra-packages: local::., any::rcmdcheck, any::remotes
needs: check

- name: Check
Expand All @@ -53,21 +57,4 @@ jobs:
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
48 changes: 48 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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: [develop]

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

0 comments on commit 04ed03e

Please sign in to comment.