From 2d9b9ff6314dadf98f1bb195d4a1e47caa008cc1 Mon Sep 17 00:00:00 2001 From: pvictor Date: Thu, 7 Jan 2021 09:52:06 +0100 Subject: [PATCH] removed travis and added coverage --- .Rbuildignore | 1 + .github/workflows/test-coverage.yaml | 48 ++++++++++++++++++++++++++++ .travis.yml | 11 ------- DESCRIPTION | 3 +- README.md | 2 +- codecov.yml | 14 ++++++++ 6 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/test-coverage.yaml delete mode 100644 .travis.yml create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index b5da114..a5e60a7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ ^examples$ ^\.github$ ^LICENSE\.md$ +^codecov\.yml$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..5910c1a --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,48 @@ +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +name: test-coverage + +jobs: + test-coverage: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v2 + with: + 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: Install dependencies + run: | + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("covr") + shell: Rscript {0} + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f783ebb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r - -language: R -sudo: false -cache: packages - -#before_cache: Rscript -e 'remotes::install_cran("pkgdown")' -#deploy: -# provider: script -# script: Rscript -e 'pkgdown::deploy_site_github()' -# skip_cleanup: true diff --git a/DESCRIPTION b/DESCRIPTION index 7c8085a..501ae9b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,8 @@ Suggests: dplyr, knitr, scales, - rmarkdown + rmarkdown, + covr RoxygenNote: 7.1.1 Roxygen: list(markdown = TRUE) URL: https://github.com/dreamRs/apexcharter, https://dreamrs.github.io/apexcharter/ diff --git a/README.md b/README.md index 4a379c4..65f30fe 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ [![version](http://www.r-pkg.org/badges/version/apexcharter)](https://CRAN.R-project.org/package=apexcharter) [![cran checks](https://cranchecks.info/badges/worst/apexcharter)](https://cranchecks.info/pkgs/apexcharter) -[![Travis build status](https://travis-ci.org/dreamRs/apexcharter.svg?branch=master)](https://travis-ci.org/dreamRs/apexcharter) [![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) [![R build status](https://github.com/dreamRs/apexcharter/workflows/R-CMD-check/badge.svg)](https://github.com/dreamRs/apexcharter/actions) +[![Codecov test coverage](https://codecov.io/gh/dreamRs/apexcharter/branch/master/graph/badge.svg)](https://codecov.io/gh/dreamRs/apexcharter?branch=master) diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..04c5585 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true