Skip to content

Commit

Permalink
Merge pull request #38 from ipeaGIT/streamline
Browse files Browse the repository at this point in the history
coverage from gtfstools
  • Loading branch information
rafapereirabr authored Sep 16, 2024
2 parents d9a8ed0 + 625b7d8 commit 51b9b4b
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,58 @@
# 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]
branches:
- main
- master
pull_request:
branches: [main, master]
branches:
- main
- master

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
id: install-r

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v2
- name: Restore R package cache
uses: actions/cache@v2
with:
extra-packages: any::covr
needs: coverage
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ubuntu-22.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-22.04-${{ steps.install-r.outputs.installed-r-version }}-1-

- name: Test coverage
- name: Install system dependencies
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("covr", execute = TRUE)
shell: Rscript {0}

- name: Show testthat output
if: always()
- name: Install dependencies
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("covr")
shell: Rscript {0}

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
- name: Test coverage
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}

0 comments on commit 51b9b4b

Please sign in to comment.