Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Sep 5, 2023
2 parents 88f867a + bd713bc commit 5d6d02a
Show file tree
Hide file tree
Showing 19 changed files with 1,294 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/pkg.lock
150 changes: 150 additions & 0 deletions .github/workflows/R-CMD-check-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# This workflow calls the GitHub API very frequently.
# Can't be run as part of commits
on:
schedule:
- cron: "5 0 * * *" # 05:00 UTC every day only run on main branch
push:
branches:
- "cran-*"
tags:
- "v*"

name: rcc dev

jobs:
matrix:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

name: Collect deps

steps:
- uses: actions/checkout@v4

- uses: ./.github/workflows/rate-limit
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
install-r: false

- id: set-matrix
uses: ./.github/workflows/dep-matrix

check-matrix:
runs-on: ubuntu-22.04
needs: matrix

name: Check deps

steps:
- name: Install json2yaml
run: |
sudo npm install -g json2yaml
- name: Check matrix definition
run: |
matrix='${{ needs.matrix.outputs.matrix }}'
echo $matrix
echo $matrix | jq .
echo $matrix | json2yaml
R-CMD-check-base:
runs-on: ubuntu-22.04

name: base

# Begin custom: services
# End custom: services

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''

- uses: ./.github/workflows/install
with:
install-r: false
cache-version: rcc-dev-base-1
needs: check
extra-packages: "any::rcmdcheck any::remotes ."
token: ${{ secrets.GITHUB_TOKEN }}

- name: Session info
run: |
options(width = 100)
if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo")
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

- uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/check
with:
results: ${{ matrix.package }}

R-CMD-check-dev:
needs:
- matrix
- R-CMD-check-base

runs-on: ubuntu-22.04

name: ${{ matrix.package }}

# Begin custom: services
# End custom: services

strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}

steps:
- uses: actions/checkout@v4

- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''

- uses: ./.github/workflows/install
with:
install-r: false
cache-version: rcc-dev-${{ matrix.package }}-1
needs: check
extra-packages: "any::rcmdcheck any::remotes ."
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dev version of ${{ matrix.package }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
remotes::install_dev("${{ matrix.package }}", "https://cloud.r-project.org", upgrade = "always")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo")
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

- uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/check
with:
results: ${{ matrix.package }}
229 changes: 229 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/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
schedule:
- cron: "10 0 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.sha }}-${{ github.base_ref || '' }}
cancel-in-progress: true

name: rcc

jobs:
rcc-smoke:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.commit.outputs.sha }}

name: "Smoke test: stock R"

# Begin custom: services
# End custom: services

steps:
- uses: actions/checkout@v4

- uses: ./.github/workflows/rate-limit
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/workflows/git-identity

- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''

- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
install-r: false
cache-version: rcc-smoke-1
needs: check
extra-packages: any::rcmdcheck any::roxygen2 r-lib/styler

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

- uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/style
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/roxygenize
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- id: commit
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/commit

- uses: ./.github/workflows/check
with:
results: ${{ runner.os }}-smoke-test

# Runs in a separate workflow, because it's using dev pkgdown
# which might bring in other dev dependencies
pkgdown:
needs: rcc-smoke

runs-on: ubuntu-latest

name: "pkgdown"

# Begin custom: services
# End custom: services

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.rcc-smoke.outputs.sha }}

- uses: ./.github/workflows/rate-limit
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/workflows/git-identity
if: github.event_name == 'push'

- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''

- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
install-r: false
cache-version: pkgdown-1
needs: website
extra-packages: r-lib/pkgdown local::.

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

- uses: ./.github/workflows/pkgdown-build
if: github.event_name != 'push'

- uses: ./.github/workflows/pkgdown-deploy
if: github.event_name == 'push'

# Windows checks can be run in parallel and independently
# when they alone take as long as the smoke and full tests combined.
# To achieve this, remove the "needs:" element below.
rcc-windows:
# Begin custom: early run
needs: rcc-smoke
# End custom: early run

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

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

# Begin custom: services
# End custom: services

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.rcc-smoke.outputs.sha }}

- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''

- uses: ./.github/workflows/install
with:
r-version: ${{ matrix.config.r }}
cache-version: rcc-windows-1
token: ${{ secrets.GITHUB_TOKEN }}
needs: check

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

- uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/check
with:
results: ${{ runner.os }}-r${{ matrix.config.r }}

rcc-full:
needs: rcc-smoke

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

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

# Begin custom: services
# End custom: services

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

- {os: ubuntu-20.04, r: 'release'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-22.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-22.04, r: 'release', covr: true, desc: 'with covr'}
- {os: ubuntu-22.04, r: 'oldrel-1'}

# Begin custom: R 3.6
- {os: ubuntu-22.04, r: 'oldrel-2'}
# End custom: R 3.6

# Begin custom: R 3.5
- {os: ubuntu-22.04, r: 'oldrel-3'}
# End custom: R 3.5

# Begin custom: R 3.4
- {os: ubuntu-22.04, r: 'oldrel-4'}
# End custom: R 3.4

# Begin custom: matrix elements
# End custom: matrix elements

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.rcc-smoke.outputs.sha }}

- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''

- uses: ./.github/workflows/install
with:
r-version: ${{ matrix.config.r }}
cache-version: rcc-full-1
token: ${{ secrets.GITHUB_TOKEN }}
needs: check

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

- uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

- uses: ./.github/workflows/check
with:
results: ${{ runner.os }}-r${{ matrix.config.r }}
Loading

0 comments on commit 5d6d02a

Please sign in to comment.