Skip to content

rcc dev

rcc dev #2336

# This workflow calls the GitHub API very frequently.
# Can't be run as part of commits
on:
schedule:
- cron: "0 5 * * *" # 05:00 UTC every day only run on main branch
push:
branches:
- "cran-*"
tags:
- "v*"
workflow_dispatch:
name: rcc dev
# Read-only by default; the jobs that need more opt back in below.
permissions:
contents: read
jobs:
matrix:
runs-on: ubuntu-26.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
name: Collect deps
steps:
- uses: actions/checkout@v6
- name: Report the GitHub API rate limit
uses: ./.github/workflows/rate-limit
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v2
- name: Collect the dependencies into a matrix
id: set-matrix
uses: ./.github/workflows/dep-matrix
check-matrix:
runs-on: ubuntu-26.04
needs: matrix
name: Check deps
steps:
- name: Install json2yaml
run: |
sudo npm install -g json2yaml
- name: Check matrix definition
# Passed through the environment rather than spliced into the script:
# the matrix is generated from DESCRIPTION in the checkout.
env:
MATRIX: ${{ needs.matrix.outputs.matrix }}
run: |
printf '%s\n' "${MATRIX}"
printf '%s' "${MATRIX}" | jq .
printf '%s' "${MATRIX}" | json2yaml
R-CMD-check-base:
runs-on: ubuntu-26.04
name: base
permissions:
# Both required by the update-snapshots action, which opens a pull
# request with refreshed snapshots.
contents: write
pull-requests: write
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v6
- name: Run the repository-specific before-install steps
uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''
- name: Install R and the package dependencies
uses: ./.github/workflows/install
with:
cache-version: rcc-dev-base-1
needs: build, 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}
- name: Run the repository-specific after-install steps
uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''
- name: Update the testthat snapshots
uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
- name: Run R CMD check
uses: ./.github/workflows/check
with:
results: ${{ matrix.package }}
R-CMD-check-dev:
needs:
- matrix
- R-CMD-check-base
runs-on: ubuntu-26.04
name: 'rcc-dev: ${{ matrix.package }}'
permissions:
# Both required by the update-snapshots action.
contents: write
pull-requests: write
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v6
- name: Run the repository-specific before-install steps
uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''
- name: Install R and the package dependencies
uses: ./.github/workflows/install
with:
cache-version: rcc-dev-${{ matrix.package }}-1
needs: build, check
extra-packages: "any::rcmdcheck r-lib/remotes@f-618-universe ."
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dev version of ${{ matrix.package }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
# r-universe builds Linux binaries for ubuntu:latest, which now tracks
# 26.04 "resolute" (it no longer publishes "noble"). This matches the
# ubuntu-26.04 runner above.
remotes::install_runiverse("${{ matrix.package }}", linux_distro = "resolute")
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}
- name: Run the repository-specific after-install steps
uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''
- name: Update the testthat snapshots
uses: ./.github/workflows/update-snapshots
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
- name: Run R CMD check
uses: ./.github/workflows/check
with:
results: ${{ matrix.package }}