From fe5cd324b68bf44329a79c5e9862ae69ad338e3a Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 15:36:48 +0200 Subject: [PATCH 1/4] test(package): #567 add RMI actions Closes: #567 --- .github/workflows/R.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 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..52df7557 --- /dev/null +++ b/.github/workflows/R.yml @@ -0,0 +1,33 @@ +--- +# 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 + + dev-r-cmd-check: + name: R CMD Check (dev versions) + uses: RMI-PACTA/actions/.github/workflows/R-CMD-check.yml@main + with: + upgrade-packages: 'TRUE' + cache-version: 'dev' + remotes: | + RMI-PACTA/r2dii.analysis + RMI-PACTA/r2dii.data + RMI-PACTA/r2dii.match From 4c02fe34e479133b25213cec6d6390a4f5631812 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 15:37:39 +0200 Subject: [PATCH 2/4] Remove redundant workflows --- .github/workflows/R-CMD-check.yaml | 62 ----------------- .../workflows/R-CMD-check_r2dii-devel.yaml | 69 ------------------- .github/workflows/test-coverage.yaml | 50 -------------- 3 files changed, 181 deletions(-) delete mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/R-CMD-check_r2dii-devel.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 e0dea0a5..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, develop] - pull_request: - branches: [main, master, develop] - -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@v3 - - - 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/R-CMD-check_r2dii-devel.yaml b/.github/workflows/R-CMD-check_r2dii-devel.yaml deleted file mode 100644 index 85f6ec02..00000000 --- a/.github/workflows/R-CMD-check_r2dii-devel.yaml +++ /dev/null @@ -1,69 +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, develop] - pull_request: - branches: [main, master, develop] - -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@v3 - - - 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.data") - 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 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index 056da9e9..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, develop] - pull_request: - branches: [main, master, develop] - -name: test-coverage - -jobs: - test-coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v3 - - - 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@v3 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package From 700024123269eb74345313651bcb7a65a71fa64a Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 10 Jun 2024 15:48:35 +0200 Subject: [PATCH 3/4] add `.lintr` --- .Rbuildignore | 15 ++++++++------- .lintr | 12 ++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .lintr diff --git a/.Rbuildignore b/.Rbuildignore index 3f471911..a5a93b16 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,14 +1,15 @@ +^LICENSE\.md$ +^README\.Rmd$ +^Rplots\.pdf$ +^\.Rproj\.user$ +^\.github$ +^\.lintr$ +^_pkgdown\.yml$ ^codecov\.yml$ ^cran-comments\.md$ ^data-raw/.*$ ^docs$ -^\.github$ -^LICENSE\.md$ +^man-roxygen$ ^pkgdown$ -^_pkgdown\.yml$ ^r2dii\.plot\.Rproj$ -^README\.Rmd$ -^\.Rproj\.user$ -^Rplots\.pdf$ ^vignettes/r2dii-plot\.Rmd$ -^man-roxygen$ diff --git a/.lintr b/.lintr new file mode 100644 index 00000000..3f2faa87 --- /dev/null +++ b/.lintr @@ -0,0 +1,12 @@ +linters: linters_with_defaults( + line_length_linter = NULL, + object_length_linter = NULL, + indentation_linter = NULL, + object_name_linter = NULL, + object_usage_linter = NULL + ) +exclusions: list( + "data-raw", + "tests/testthat/", + "vignettes/" + ) From 99a50badccdb7ca6402e3f2e8ac89fb03024d9d8 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Tue, 11 Jun 2024 12:00:03 +0200 Subject: [PATCH 4/4] Trigger CI following merge of https://github.com/RMI-PACTA/actions/pull/94