Skip to content

Commit

Permalink
Fix test7: test_coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
klau506 committed Dec 13, 2023
1 parent 9ad36c7 commit 15b1823
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,50 @@ on:
- gcam-v7.0

jobs:
test-coverage:
test:
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GH_GCAMREPORT_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{secrets.GH_GCAMREPORT_TOKEN}}

steps:
- uses: actions/checkout@v3

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

- uses: r-lib/actions/setup-r@v2
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2-branch
with:
use-public-rspm: true
r-version: '4.1.0'
- uses: r-lib/actions/setup-pandoc@v2-branch
- uses: r-lib/actions/setup-tinytex@v2-branch
- uses: actions/download-artifact@v2

- uses: r-lib/actions/setup-r-dependencies@v2
- name: Cache R packages
uses: actions/cache@v1
with:
extra-packages: any::covr
needs: coverage
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-

- name: Test coverage
- name: Ubuntu config
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libssl-dev libxml2-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev libmagick++-dev libavfilter-dev
- name: Show testthat output
if: always()
- name: Install dependencies
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
install.packages(c("remotes","rcmdcheck","covr"), repos = "https://cloud.r-project.org")
remotes::install_github("JGCRI/rpackageutils")
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

# - name: Test coverage
# run: |
# cov <- covr::package_coverage()
# covr:::report(cov, file = "coverage.xml")
# shell: Rscript {0}

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
- uses: codecov/codecov-action@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
# token: ${{secrets.CODECOV_TOKEN}}
files: ./coverage.xml
verbose: true

0 comments on commit 15b1823

Please sign in to comment.