From 7311a3de60c4faa7cd65ab6e990c7ee81938f0b3 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 13:25:19 +0200 Subject: [PATCH 1/6] test(package): #386 Add standard RMI action Closes: #386 --- .github/workflows/R.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/R.yml diff --git a/.github/workflows/R.yml b/.github/workflows/R.yml new file mode 100644 index 00000000..1023ad1b --- /dev/null +++ b/.github/workflows/R.yml @@ -0,0 +1,22 @@ +--- +# This example file will enable R language checks on push or PR to the main +# branch. +# It will also run the checks every weeknight at midnight UTC +# +# Note the @main in `uses:` on the last line. This will call the latest version +# of the workflow from the `main` brnach in the RMI-PACTA/actions repo. You can +# also specify a tag from that repo, or a commit SHA to pin action versions. +on: + pull_request: + push: + branches: [main] + schedule: + - cron: '0 0 * * 1,2,3,4,5' + workflow_dispatch: + +name: R + +jobs: + R-package: + name: R Package Checks + uses: RMI-PACTA/actions/.github/workflows/R.yml@main From 975c9c6043ce75199937724aca78034f1a7a1473 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 13:26:32 +0200 Subject: [PATCH 2/6] test(package): #386 Remove redundant tests --- .github/workflows/R-CMD-check.yaml | 62 ---------------------------- .github/workflows/test-coverage.yaml | 50 ---------------------- 2 files changed, 112 deletions(-) delete mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index 07c1dfad..00000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -# -# NOTE: This workflow is overkill for most R packages and -# check-standard.yaml is likely a better choice. -# usethis::use_github_action("check-standard") will install it. -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'} - # Use 3.6 to trigger usage of RTools35 - - {os: windows-latest, r: '3.6'} - # use 4.1 to check with rtools40's older compiler - - {os: windows-latest, r: '4.1'} - - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: 'oldrel-2'} - - {os: ubuntu-latest, r: 'oldrel-3'} - - {os: ubuntu-latest, r: 'oldrel-4'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - 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@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index 07badcc9..00000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/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: test-coverage - -jobs: - test-coverage: - 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: any::covr - needs: coverage - - - name: Test coverage - run: | - covr::codecov( - quiet = FALSE, - clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") - ) - shell: Rscript {0} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload test results - if: failure() - uses: actions/upload-artifact@v4 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package From b35485afa0fb8d054102b66a5033e155102eef64 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 13:27:30 +0200 Subject: [PATCH 3/6] test(package): #387 Remove Dev tests Remove tests against dev dependencies (there are none) Closes: #387 --- .../workflows/R-CMD-check_r2dii-devel.yaml | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 .github/workflows/R-CMD-check_r2dii-devel.yaml diff --git a/.github/workflows/R-CMD-check_r2dii-devel.yaml b/.github/workflows/R-CMD-check_r2dii-devel.yaml deleted file mode 100644 index 640a42cf..00000000 --- a/.github/workflows/R-CMD-check_r2dii-devel.yaml +++ /dev/null @@ -1,68 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -# -# NOTE: This workflow is overkill for most R packages and -# check-standard.yaml is likely a better choice. -# usethis::use_github_action("check-standard") will install it. -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: R-CMD-check r2dii-devel - -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'} - # Use 3.6 to trigger usage of RTools35 - - {os: windows-latest, r: '3.6'} - # use 4.1 to check with rtools40's older compiler - - {os: windows-latest, r: '4.1'} - - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: 'oldrel-2'} - - {os: ubuntu-latest, r: 'oldrel-3'} - - {os: ubuntu-latest, r: 'oldrel-4'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - 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@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - name: Install devel version of other r2dii packages - run: | - pak::pkg_install("RMI-PACTA/r2dii.match") - pak::pkg_install("RMI-PACTA/r2dii.analysis") - shell: Rscript {0} - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true From 40865af70ed75fb3a389f92c96de2c6f06418c80 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 14:04:02 +0200 Subject: [PATCH 4/6] test(package): #386 lintr exclusions --- .lintr | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .lintr diff --git a/.lintr b/.lintr new file mode 100644 index 00000000..ad040dca --- /dev/null +++ b/.lintr @@ -0,0 +1,5 @@ +exclusions: list( + "data-raw", + "tests/testthat/", + "vignettes/r2dii-data-0-0-3.Rmd" + ) From d64e4b937e88d0d5310bcc4c15343e1815eb191b Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 14:06:45 +0200 Subject: [PATCH 5/6] Add `.lintr` to Rbuildignore --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index 04a4f32e..5a2f268b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,6 +3,7 @@ ^README\.Rmd$ ^\.Rproj\.user$ ^\.github$ +^\.lintr$ ^_pkgdown\.yml$ ^codecov\.yml$ ^cran-comments\.md$ From 1ed0d580ed5d8d3915f64a92e4d3823e51eb184c Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Tue, 11 Jun 2024 11:55:02 +0200 Subject: [PATCH 6/6] update `.lintr` --- .lintr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lintr b/.lintr index ad040dca..f2954551 100644 --- a/.lintr +++ b/.lintr @@ -1,5 +1,5 @@ exclusions: list( "data-raw", "tests/testthat/", - "vignettes/r2dii-data-0-0-3.Rmd" + "vignettes/" )