diff --git a/.Rbuildignore b/.Rbuildignore index eee7e42d..4c99f154 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ +^CRAN-RELEASE$ ^LICENSE\.md$ ^README\.Rmd$ ^\.Rproj\.user$ @@ -6,18 +7,18 @@ ^\.github/workflows/pkgdown\.yaml$ ^\.github/workflows/pr-commands\.yaml$ ^\.github/workflows/render-readme\.yaml$ +^\.lintr$ ^_pkgdown\.yml$ ^codecov\.yml$ +^cran-comments\.md$ ^data-raw$ ^docs$ ^man-roxygen$ ^pkgdown$ ^r2dii\.analysis\.Rproj$ +^revdep$ +^vignettes/articles$ +^vignettes/production-percent-change\.Rmd$ ^vignettes/r2dii-analysis\.Rmd$ ^vignettes/target-market-share\.Rmd$ ^vignettes/target-sda\.Rmd$ -^vignettes/production-percent-change\.Rmd$ -^cran-comments\.md$ -^vignettes/articles$ -^revdep$ -^CRAN-RELEASE$ 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/R-CMD-check_r2dii-devel.yaml b/.github/workflows/R-CMD-check_r2dii-devel.yaml deleted file mode 100644 index 21dfd8ad..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.data") - pak::pkg_install("RMI-PACTA/r2dii.match") - shell: Rscript {0} - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true diff --git a/.github/workflows/R.yml b/.github/workflows/R.yml new file mode 100644 index 00000000..577bb11c --- /dev/null +++ b/.github/workflows/R.yml @@ -0,0 +1,32 @@ +--- +# 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.data + RMI-PACTA/r2dii.match 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 diff --git a/.lintr b/.lintr new file mode 100644 index 00000000..cd5a1594 --- /dev/null +++ b/.lintr @@ -0,0 +1,17 @@ +linters: linters_with_defaults( + assignment_linter = NULL, + commas_linter = NULL, + indentation_linter = NULL, + line_length_linter = NULL, + object_length_linter = NULL, + object_name_linter = NULL, + object_usage_linter = NULL, + spaces_left_parentheses_linter = NULL, + vector_logic_linter = NULL + ) +exclusions: list( + "data-raw", + "tests/testthat/", + "vignettes/" + ) +