-
Notifications
You must be signed in to change notification settings - Fork 62
368 lines (315 loc) · 9.95 KB
/
nightly.yaml
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
name: Nighly build
on:
workflow_dispatch:
inputs:
macos:
description: 'Build x86_64 macOS packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
windows:
description: 'Build Windows packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
linux:
description: 'Build x86_64 Linux packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
macos-m1:
description: 'Build arm64 macOS packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'no'
linux-arm64:
description: 'Build arm64 Linux packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
deploy:
description: 'Deploy packages'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
schedule:
- cron: '30 5 * * *'
# =========================================================================
jobs:
debug:
runs-on: ubuntu-latest
if: always()
name: Parameters
steps:
- name: Input parameters
run: |
echo "macos: ${{ github.event.inputs.macos }}"
echo "windows: ${{ github.event.inputs.windows }}"
echo "linux: ${{ github.event.inputs.linux }}"
echo "macos-m1: ${{ github.event.inputs.macos-m1 }}"
echo "linux-arm64: ${{ github.event.inputs.linux-arm64 }}"
echo "deploy: ${{ github.event.inputs.deploy }}"
echo "macos: ${{ github.event.inputs.macos == 'yes' }}"
echo "windows: ${{ github.event.inputs.windows == 'yes' }}"
echo "linux: ${{ github.event.inputs.linux == 'yes' }}"
echo "macos-m1: ${{ github.event.inputs.macos-m1 == 'yes' }}"
echo "linux-arm64: ${{ github.event.inputs.linux-arm64 == 'yes' }}"
echo "deploy: ${{ github.event.inputs.deploy == 'yes' }}"
# -----------------------------------------------------------------------
macos:
runs-on: macos-11
if: ${{ github.event.inputs.macos == '' || github.event.inputs.macos == 'yes' }}
name: macOS x86_64 pak binaries
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Install rig
run: |
brew tap r-lib/rig
brew install r-lib/rig/rig
- name: Install R
run: |
sudo rig add 3.5
sudo rig add 3.6
sudo rig add 4.0
sudo rig add 4.1
sudo rig add 4.2
sudo rig add release
sudo rig add devel
rig default release
- name: Install skopeo
run: |
brew install skopeo
brew link skopeo
skopeo --version
- name: Build pak binaries
run: |
cd tools/build/macos && make build
- name: Run tests
run: |
cd tools/build/macos && make test
- name: Deploy packages
run: |
cd tools/build/macos && make deploy
env:
PAK_GHCR_TOKEN: ${{ secrets.PAK_GHCR_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# -----------------------------------------------------------------------
windows:
runs-on: windows-latest
if: ${{ github.event.inputs.windows == '' || github.event.inputs.windows == 'yes' }}
name: Windows pak binaries
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: git config
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
- name: Install rig
run: |
choco install rig
# For make
echo "C:\rtools40\usr\bin" | Out-File -Append -FilePath $env:GITHUB_PATH
- name: Install skopeo
run: |
Invoke-WebRequest -Uri https://github.com/gaborcsardi/skopeo/releases/download/v1.6.0/skopeo-1.6.0.zip -OutFile skopeo.zip
New-Item "C:\Tools" -Force -ItemType Directory
Expand-Archive skopeo.zip -DestinationPath C:\Tools
echo "C:\Tools\skopeo" | Out-File -Append -FilePath $env:GITHUB_PATH
- name: Test skopeo
run: |
skopeo --version
# We use the pre-installed R 4.1.3 + Rtools40 for now, to speed this up
- name: Install R and RTools
run: |
rig add 3.5
rig add 3.6
rig add 4.0
rig add 4.1
rig add 4.2
rig add 4.3
rig add devel
rig add rtools35
rig add rtools40
rig default 4.2.3
- name: Build pak binaries
run: |
cd tools/build/windows && make build
- name: Run tests
run: |
cd tools/build/windows && make test
- name: Deploy packages
run: |
cd tools/build/windows && make deploy
env:
PAK_GHCR_TOKEN: ${{ secrets.PAK_GHCR_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# -----------------------------------------------------------------------
linux:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.linux == '' || github.event.inputs.linux == 'yes' }}
name: Linux static pak binaries for R ${{ matrix.config.r }}, ${{ matrix.config.platform }}
strategy:
fail-fast: false
matrix:
config:
- { r: '4.4', platform: 'linux/amd64' }
- { r: '4.3', platform: 'linux/amd64' }
- { r: '4.2', platform: 'linux/amd64' }
- { r: '4.1', platform: 'linux/amd64' }
- { r: '4.0', platform: 'linux/amd64' }
- { r: '3.6', platform: 'linux/amd64' }
- { r: '3.5', platform: 'linux/amd64' }
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Build and push
run: |
docker build \
--pull \
--build-arg ARCH=x86_64 \
--build-arg R_MAJOR=${{ matrix.config.r }} \
--build-arg TOKEN=${{ secrets.PAK_GHCR_TOKEN }} \
--build-arg PAK_ROOT=. \
-f tools/build/linux/Dockerfile .
# ------------------------------------------------------------------------
macos-m1:
runs-on: [macos-arm64]
if: ${{ github.event.inputs.macos-m1 == 'yes' }}
name: macos arm64 pak binaries
env:
RVERSIONS: "4.1-arm64 4.2-arm64 4.3-arm64 4.4-arm64"
RVERSION_DEFAULT: 4.3-arm64
defaults:
run:
shell: "/usr/bin/arch -arch arm64 /bin/bash {0}"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: git config
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
- name: Build pak binaries
run: |
cd tools/build/macos && make build
- name: Run tests
run: |
cd tools/build/macos && make test
- name: Deploy packages
run: |
cd tools/build/macos && make deploy
env:
PAK_GHCR_TOKEN: ${{ secrets.PAK_GHCR_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# ------------------------------------------------------------------------
linux-arm64:
runs-on: [linux-arm64]
if: ${{ github.event.inputs.linux-arm64 == '' || github.event.inputs.linux-arm64 == 'yes' }}
name: Linux static pak binaries for R ${{ matrix.config.r }}, ${{ matrix.config.platform }}
strategy:
fail-fast: false
matrix:
config:
- { r: '4.4', platform: 'linux/arm64' }
- { r: '4.3', platform: 'linux/arm64' }
- { r: '4.2', platform: 'linux/arm64' }
- { r: '4.1', platform: 'linux/arm64' }
- { r: '4.0', platform: 'linux/arm64' }
- { r: '3.6', platform: 'linux/arm64' }
- { r: '3.5', platform: 'linux/arm64' }
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Build and push
run: |
docker system prune -f
docker build \
--pull \
--build-arg ARCH=aarch64 \
--build-arg R_MAJOR=${{ matrix.config.r }} \
--build-arg TOKEN=${{ secrets.PAK_GHCR_TOKEN }} \
--build-arg PAK_ROOT=. \
-f tools/build/linux/Dockerfile .
# ------------------------------------------------------------------------
deploy:
runs-on: ubuntu-latest
if: ${{ (github.event.inputs.deploy == '' || github.event.inputs.deploy == 'yes') && always() }}
needs: [ macos, windows, linux, macos-m1, linux-arm64 ]
steps:
- name: Update Ubuntu package db
run: |
sudo apt-get update
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Create user library
run: |
dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
shell: Rscript {0}
- name: Dependencies
uses: r-lib/actions/setup-r-dependencies@v2-branch
- name: Install local pak tree
run: R CMD INSTALL .
env:
PAK_BUNDLE: false
- name: Create repository
run: |
pak:::create_pak_repo("repo")
shell: Rscript {0}
- name: Deploy to GitHub pages (test)
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
repository-name: r-lib/r-lib.github.io
token: ${{ secrets.PAK_GHCR_TOKEN }}
single-commit: true
clean: true
branch: test
folder: repo
- name: Run tests
run: |
testthat::test_local(filter = "^repo$")
shell: Rscript {0}
env:
PAK_TESTS: true
- name: Deploy to GitHub Pages (prod)
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
repository-name: r-lib/r-lib.github.io
token: ${{ secrets.PAK_GHCR_TOKEN }}
single-commit: true
clean: true
branch: gh-pages
folder: repo