From e19bc2ca47ed20f2add2686e14959d9a08abdf82 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sat, 29 Jun 2024 14:55:45 +0200 Subject: [PATCH 1/2] Check examples with stricter settings --- .github/workflows/check-all-examples.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-all-examples.yaml b/.github/workflows/check-all-examples.yaml index 36415fc90..d1f1507f0 100644 --- a/.github/workflows/check-all-examples.yaml +++ b/.github/workflows/check-all-examples.yaml @@ -37,6 +37,12 @@ jobs: - name: Run examples run: | - options(crayon.enabled = TRUE) + options( + crayon.enabled = TRUE, + warn = 2L, + warnPartialMatchArgs = TRUE, + warnPartialMatchAttr = TRUE, + warnPartialMatchDollar = TRUE + ) devtools::run_examples(fresh = TRUE, run_dontrun = TRUE, run_donttest = TRUE) shell: Rscript {0} From 27a07d52ea23ec4b7698efd678c50aa1c9e36992 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Mon, 1 Jul 2024 16:03:34 +0200 Subject: [PATCH 2/2] Create check-test-warnings.yaml --- .github/workflows/check-test-warnings.yaml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/check-test-warnings.yaml diff --git a/.github/workflows/check-test-warnings.yaml b/.github/workflows/check-test-warnings.yaml new file mode 100644 index 000000000..414385293 --- /dev/null +++ b/.github/workflows/check-test-warnings.yaml @@ -0,0 +1,39 @@ +# based on test-coverage, running testthat with options(warn = 2) to fail on test warnings +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: test-package + +jobs: + test-package: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: local::. + + - name: Run Tests + run: | + ## -------------------------------------------------------------------- + options( + crayon.enabled = TRUE, + warn = 2L, + warnPartialMatchArgs = TRUE, + warnPartialMatchAttr = TRUE, + warnPartialMatchDollar = TRUE + ) + if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") + testthat::test_dir("tests") + shell: Rscript {0}