From b9901fd421e532453baab9b82575fadd56367bcb Mon Sep 17 00:00:00 2001 From: kaneplusplus Date: Mon, 14 Jun 2021 14:50:05 -0400 Subject: [PATCH] Added test-coverage. --- .github/workflows/test-coverage.yaml | 48 ++++++++++++++++++++++++++++ cran-comments.md | 4 +-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..ba1f94f --- /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: Restore R package cache + 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/cran-comments.md b/cran-comments.md index fd5581e..f3a1b6d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,6 @@ ## Test environments -* local R installation, R 4.0.5 -* ubuntu 16.04 (on travis-ci), R 4.0.5 +* local R installation, R 4.0.6 +* ubuntu 16.04 (on travis-ci), R 4.0.6 * win-builder (devel) ## R CMD check results