From d01a229c5008a6bbd83366412f1faf86bb84ce72 Mon Sep 17 00:00:00 2001 From: timelyportfolio Date: Sun, 19 Sep 2021 13:57:15 -0500 Subject: [PATCH] add `usethis` github action to check package --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 58 ++++++++++++++++++++++++++++++ README.md | 2 +- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 2e924f1..8b7d73c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -5,3 +5,4 @@ ^CONDUCT\.md$ ^docs$ ^javascript$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..0528262 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,58 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-pandoc@v1 + + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v1 + with: + extra-packages: rcmdcheck + + - uses: r-lib/actions/check-r-package@v1 + + - 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 diff --git a/README.md b/README.md index 99961e0..14ec50c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/sunburstR)](https://cran.r-project.org/package=sunburstR) +[![R-CMD-check](https://github.com/timelyportfolio/sunburstR/workflows/R-CMD-check/badge.svg)](https://github.com/timelyportfolio/sunburstR/actions) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/sunburstR)](https://cran.r-project.org/package=sunburstR) ### Help Me/Pay Me to Use, Improve, and Extend