diff --git a/.github/workflows/dev-tests.yaml b/.github/workflows/dev-tests.yaml index b453cdd..a4d17da 100644 --- a/.github/workflows/dev-tests.yaml +++ b/.github/workflows/dev-tests.yaml @@ -1,13 +1,12 @@ +# 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 + branches: [main, master] pull_request: - branches: - - main - workflow_dispatch: + branches: [main, master] -name: dev tests +name: R-CMD-check jobs: R-CMD-check: @@ -19,70 +18,28 @@ jobs: fail-fast: false matrix: config: - - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-latest, r: 'release'} env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - - name: Checkout this repo - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Setup R on system - uses: r-lib/actions/setup-r@v2 + - 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 - - name: Install pak and query dependencies - run: | - install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - pak::pkg_install("rstudio/chromote") - pak::pkg_install("rstudio/webshot2") - saveRDS(pak::pkg_deps_tree("local::.", dependencies = TRUE), ".github/r-depends.rds") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - run: | - pak::local_system_requirements(execute = TRUE) - processx::run("sh", c("-c", "sudo apt-get install -y chromium-browser"), stderr_to_stdout = TRUE) - shell: Rscript {0} - - - name: Install dependencies - run: pak::local_install_dev_deps(upgrade = TRUE) - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Tests - run: testthat::test_local() - shell: Rscript {0} - - - name: Coverage - run: covr::package_coverage() - shell: Rscript {0} - - - name: R CMD check - run: devtools::check(document = FALSE) - shell: Rscript {0} + extra-packages: any::rcmdcheck + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true