Skip to content

Commit

Permalink
Update to modern CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemahoney218 committed Feb 1, 2024
1 parent e5c1df5 commit 246b4ff
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 80 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/R-CMD-check-hard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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 only directly installs "hard" dependencies, i.e. Depends,
# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never
# installed, with the exception of testthat, knitr, and rmarkdown. The cache is
# never used to avoid accidentally restoring a cache containing a suggested
# dependency.
on:
push:
branches: [main]
pull_request:
branches: [main]

name: R-CMD-check-hard

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
cache: false
extra-packages: |
any::rcmdcheck
any::testthat
any::knitr
any::rmarkdown
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
55 changes: 21 additions & 34 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
- '*'
- '!gh-pages'
branches: [main, master]
pull_request:
branches:
- '*'
- '!gh-pages'
branches: [main, master]

name: R-CMD-check

Expand All @@ -23,7 +23,9 @@ jobs:
matrix:
config:
- {os: macOS-latest, r: 'release'}

- {os: windows-latest, r: 'release'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
Expand All @@ -35,37 +37,22 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- 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 remotes
run: |
install.packages("remotes")
shell: Rscript {0}

- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install proj
brew install gdal
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 3
extra-packages: any::rcmdcheck, CAST=?ignore-before-r=4.1.0
needs: check

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
env:
_R_CHECK_FORCE_SUGGESTS_: false
with:
upload-snapshots: true
29 changes: 0 additions & 29 deletions .github/workflows/lint.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Lock Threads'

on:
schedule:
- cron: '0 0 * * *'

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '14'
# issue-exclude-labels: ''
# issue-lock-labels: 'outdated'
issue-lock-comment: >
This issue has been automatically locked. If you believe you have
found a related problem, please file a new issue (with a reprex:
<https://reprex.tidyverse.org>) and link to this issue.
issue-lock-reason: ''
pr-lock-inactive-days: '14'
# pr-exclude-labels: 'wip'
pr-lock-labels: ''
pr-lock-comment: >
This pull request has been automatically locked. If you believe you
have found a related problem, please file a new issue (with a reprex:
<https://reprex.tidyverse.org>) and link to this issue.
pr-lock-reason: ''
# process-only: 'issues'
28 changes: 16 additions & 12 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
issue_comment:
Expand All @@ -16,20 +16,22 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/pr-fetch@v1
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: roxygen2
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
Expand All @@ -38,7 +40,7 @@ jobs:
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v1
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -51,17 +53,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/pr-fetch@v1
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: Rscript -e 'styler::style_pkg()'
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
Expand All @@ -70,6 +74,6 @@ jobs:
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v1
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 12 additions & 5 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
Expand All @@ -17,14 +17,21 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: any::covr
needs: coverage
cache-version: 2

- name: Update dependencies
run: |
install.packages("purrr", repos = 'https://cloud.r-project.org')
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}

0 comments on commit 246b4ff

Please sign in to comment.