-
Notifications
You must be signed in to change notification settings - Fork 55
174 lines (138 loc) · 5.2 KB
/
Copy pathR-CMD-check-dev.yaml
File metadata and controls
174 lines (138 loc) · 5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# 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 }}