Skip to content

Commit

Permalink
upgrade dev test to latest v2 version (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjyetman committed Dec 15, 2023
1 parent 278bd2b commit f11418a
Showing 1 changed file with 18 additions and 61 deletions.
79 changes: 18 additions & 61 deletions .github/workflows/dev-tests.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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

0 comments on commit f11418a

Please sign in to comment.