Skip to content

Commit

Permalink
Update and simplify GitHub Action workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
klmr committed Apr 22, 2023
1 parent e2d42cd commit eab9bb0
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 125 deletions.
96 changes: 0 additions & 96 deletions .github/workflows/R-CMD-check.yaml

This file was deleted.

34 changes: 5 additions & 29 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Dev build

on:
push:
branches:
- main
branches: [main]
workflow_dispatch:

jobs:
Expand All @@ -12,34 +11,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up R
uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2

- name: Install external library dependencies
run: sudo apt-get install -y libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), '.github/r-depends.rds', version = 2L)
writeLines(sprintf('R-%i.%i', getRversion()$major, getRversion()$minor), '.github/r-version')
shell: Rscript {0}

- name: Cache R library
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ hashFiles('.github/r-version') }}-2-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ hashFiles('.github/r-version') }}-2-

- name: Install R package dependencies
run: |
install.packages(c('remotes', 'rcmdcheck'))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2

- name: Build package
run: |
Expand All @@ -59,4 +35,4 @@ jobs:
git checkout -b dev
git add --force NAMESPACE man
git commit -m 'Create a development release'
git push --force --set-upstream origin dev
git push --force origin dev
57 changes: 57 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: R CMD check

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 0 * * 2"
workflow_dispatch:

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

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

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'oldrel'}
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'devel', http-user-agent: ' release'}

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: Build package for checking
run: |
# Workaround for bug #1070 in roxygen2 7.1.0
writeLines('# Generated by roxygen2: do not edit by hand', 'NAMESPACE')
devtools::document()
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

0 comments on commit eab9bb0

Please sign in to comment.