blob: db9f6593a943584e7b5f6e33d00eaca499f8c29d (
plain)
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
|
name: Refresh Build Caches
on:
push:
branches: [develop]
paths:
- ".github/workflows/ci.yml"
- ".github/workflows/release.yml"
- ".github/workflows/build-linux.yml"
- ".github/workflows/warm-dependency-caches.yml"
- ".github/actions/build-linux-payload/**"
- ".github/images/linux-ci/**"
- ".github/scripts/linux-ci-image-config.sh"
- ".github/scripts/linux-ci-image-fingerprint.sh"
- ".github/scripts/linux-ci-image-inputs.sh"
- ".github/scripts/linux-ccache-compiler-signature.sh"
- ".github/scripts/select-ccache-key-suffix.sh"
- ".github/scripts/select-linux-ccache-save.sh"
- ".github/scripts/run-apt-get.sh"
- ".github/scripts/build-pfunit-linux.sh"
- ".github/scripts/build-hamlib-linux.sh"
- ".github/scripts/tsan-linux-deps-config.sh"
- ".github/scripts/build-qt-tsan-linux.sh"
- ".github/scripts/build-boost-tsan-linux.sh"
- ".github/scripts/build-hamlib-tsan-linux.sh"
- ".github/scripts/verify-linux-ci-image.sh"
- ".github/scripts/verify-tsan-deps-linux.sh"
- ".github/workflows/build-macos.yml"
- ".github/workflows/build-windows.yml"
- ".github/actions/warm-macos-deps/**"
- ".github/actions/build-windows-deps/**"
- ".github/scripts/build-*-macos.sh"
- ".github/scripts/build-*-windows.sh"
- ".github/scripts/*armhf*"
- ".github/scripts/install-*-macos*.sh"
- ".github/scripts/macos-qt-cache-key.sh"
- ".github/scripts/verify-macos-*.sh"
schedule:
- cron: "23 10 * * 1"
- cron: "17 9 1 * *"
workflow_dispatch:
inputs:
targets:
description: "Platform caches to warm"
required: false
type: choice
options:
- macos-arm64
- macos-x86_64
- macos
- windows
- linux
- linux-arm64
- linux-tsan
- linux-images
- linux-retention
- all
default: macos-arm64
hamlib_branch:
description: "Hamlib branch to build"
required: false
type: string
default: "4.7.2"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
detect:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
packages: read
outputs:
linux_images: ${{ steps.detect.outputs.linux_images }}
linux_arm64: ${{ steps.detect.outputs.linux_arm64 }}
retention: ${{ steps.detect.outputs.retention }}
windows: ${{ steps.detect.outputs.windows }}
macos_arm64: ${{ steps.detect.outputs.macos_arm64 }}
macos_x86_64: ${{ steps.detect.outputs.macos_x86_64 }}
image_set: ${{ steps.detect.outputs.image_set }}
hamlib_branch: ${{ steps.detect.outputs.hamlib_branch }}
version: ${{ steps.detect.outputs.version }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 2
- id: detect
name: Select cache warmers
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
SCHEDULE: ${{ github.event.schedule }}
BEFORE_SHA: ${{ github.event.before }}
CURRENT_SHA: ${{ github.sha }}
TARGETS: ${{ inputs.targets || '' }}
HAMLIB_BRANCH: ${{ inputs.hamlib_branch || '4.7.2' }}
run: |
set -euo pipefail
.github/scripts/validate-ci-inputs.sh
normal_images=false
tsan_images=false
retention=false
linux_arm64=false
windows=false
macos_arm64=false
macos_x86_64=false
enable_cache_all() {
linux_arm64=true
windows=true
macos_arm64=true
macos_x86_64=true
}
enable_all() {
normal_images=true
retention=true
enable_cache_all
}
case "$EVENT_NAME" in
schedule)
retention=true
# Refresh the promoted image monthly only when no newer refresh occurred.
if [ "$SCHEDULE" = "17 9 1 * *" ] && \
python3 .github/scripts/should-refresh-linux-ci-images.py --max-age-days 30; then
normal_images=true
tsan_images=true
elif [ "$SCHEDULE" = "23 10 * * 1" ]; then
enable_cache_all
fi
;;
workflow_dispatch)
case "$TARGETS" in
all)
enable_all
;;
linux|linux-images)
normal_images=true
linux_arm64=true
;;
linux-arm64)
linux_arm64=true
;;
linux-tsan)
tsan_images=true
;;
linux-retention)
retention=true
;;
windows)
windows=true
;;
macos)
macos_arm64=true
macos_x86_64=true
;;
macos-arm64)
macos_arm64=true
;;
macos-x86_64)
macos_x86_64=true
;;
*)
echo "::error::Unsupported targets input: $TARGETS"
exit 2
;;
esac
;;
push)
if [ -n "$BEFORE_SHA" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
base="$BEFORE_SHA"
else
base="${CURRENT_SHA}^"
fi
if ! git cat-file -e "${base}^{commit}" 2>/dev/null; then
git fetch --no-tags --depth=1 origin "$base" || true
fi
if git cat-file -e "${base}^{commit}" 2>/dev/null; then
changed="$(git diff --name-only "$base" "$CURRENT_SHA")"
else
echo "::notice::Could not compare $base..$CURRENT_SHA; warming all dependency caches"
changed=""
enable_all
tsan_images=true
fi
while IFS= read -r path; do
[ -n "$path" ] || continue
case "$path" in
.github/workflows/ci.yml|.github/workflows/release.yml|.github/workflows/warm-dependency-caches.yml|.github/scripts/select-ccache-key-suffix.sh)
enable_cache_all
;;
.github/workflows/build-linux.yml|.github/actions/build-linux-payload/*|.github/scripts/select-linux-ccache-save.sh)
linux_arm64=true
;;
.github/workflows/build-windows.yml|.github/actions/build-windows-deps/*|.github/scripts/build-boost-windows.sh|.github/scripts/build-pfunit-windows.sh|.github/scripts/build-hamlib-windows.sh)
windows=true
;;
.github/workflows/build-macos.yml|.github/actions/warm-macos-deps/*|.github/scripts/build-*-macos.sh|.github/scripts/install-*-macos*.sh|.github/scripts/macos-qt-cache-key.sh|.github/scripts/verify-macos-*.sh)
macos_arm64=true
macos_x86_64=true
;;
*)
case "$(.github/scripts/is-linux-ci-image-input.sh --classify "$path")" in
normal)
normal_images=true
;;
tsan)
tsan_images=true
;;
normal-and-tsan)
normal_images=true
tsan_images=true
;;
esac
;;
esac
done <<< "$changed"
;;
*)
echo "::error::Unsupported event: $EVENT_NAME"
exit 2
;;
esac
if [ "$normal_images" = true ] && [ "$tsan_images" = true ]; then
image_set=normal-and-tsan
elif [ "$normal_images" = true ]; then
image_set=normal
elif [ "$tsan_images" = true ]; then
image_set=tsan
else
image_set=none
fi
linux_images=false
if [ "$image_set" != none ]; then
linux_images=true
fi
VERSION=$(awk -F= '$1 == "version" {print $2; exit}' release-state.txt)
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Could not derive VERSION from release-state.txt"
exit 1
fi
{
echo "linux_images=$linux_images"
echo "linux_arm64=$linux_arm64"
echo "retention=$retention"
echo "windows=$windows"
echo "macos_arm64=$macos_arm64"
echo "macos_x86_64=$macos_x86_64"
echo "image_set=$image_set"
echo "hamlib_branch=$HAMLIB_BRANCH"
echo "version=$VERSION"
} >> "$GITHUB_OUTPUT"
{
echo "## Build cache warmer selection"
echo
echo "| Target | Enabled |"
echo "| --- | --- |"
echo "| Linux GHCR image set | $image_set |"
echo "| Linux arm64 ccache | $linux_arm64 |"
echo "| Linux GHCR retention | $retention |"
echo "| Windows x86_64 | $windows |"
echo "| macOS arm64 | $macos_arm64 |"
echo "| macOS x86_64 | $macos_x86_64 |"
} >> "$GITHUB_STEP_SUMMARY"
refresh-linux-images:
needs: detect
if: needs.detect.outputs.linux_images == 'true'
uses: ./.github/workflows/publish-linux-ci-images.yml
permissions:
contents: read
packages: write
with:
# ARMHF is part of the normal Linux image cohort. The reusable publisher
# validates and promotes its paired images before dependent builds resolve them.
promote: true
include_armhf: true
image_set: ${{ needs.detect.outputs.image_set }}
retain-linux-images:
needs: [detect, refresh-linux-images]
if: >-
always() &&
needs.detect.outputs.retention == 'true' &&
(needs.refresh-linux-images.result == 'success' ||
needs.refresh-linux-images.result == 'skipped')
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
packages: write
concurrency:
group: linux-ci-image-publishing
cancel-in-progress: false
steps:
- uses: actions/checkout@v7
- name: Apply GHCR retention
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLY: ${{ github.event_name == 'schedule' }}
shell: bash
run: |
args=(
--owner WSJTX
--max-age-days 60
--keep 3
--package wsjtx-internal/linux-noble
--package wsjtx-internal/linux-tsan-noble
--package wsjtx-internal/linux-arm64-bookworm
--package wsjtx-internal/linux-armhf-cross-bookworm
--package wsjtx-internal/linux-armv7-bookworm
)
if [ "$APPLY" = true ]; then
args+=(--apply)
fi
.github/scripts/ghcr_retention.py "${args[@]}"
warm-linux-arm64-ccache:
needs: detect
if: >-
github.ref == 'refs/heads/develop' &&
needs.detect.outputs.linux_arm64 == 'true' &&
needs.detect.outputs.image_set != 'normal' &&
needs.detect.outputs.image_set != 'normal-and-tsan'
uses: ./.github/workflows/build-linux.yml
permissions:
contents: read
packages: read
with:
version: ${{ needs.detect.outputs.version }}
hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }}
arch: aarch64
save_ccache: true
warm-windows-x86_64-deps:
needs: detect
if: needs.detect.outputs.windows == 'true'
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Disable core.autocrlf before checkout
shell: pwsh
run: git config --global core.autocrlf false
- uses: actions/checkout@v7
# Boost is source-built by build-windows-deps so the Windows 7 API floor
# and Boost.Atomic patch stay pinned; do not install MSYS2 Boost here.
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
cache: true
install: >-
git make tar curl
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-cmake
mingw-w64-x86_64-python
mingw-w64-x86_64-pkg-config
autoconf automake libtool
- uses: ./.github/actions/build-windows-deps
with:
hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }}
save_caches: "true"
warm-windows-ccache:
needs: [detect, warm-windows-x86_64-deps]
if: needs.detect.outputs.windows == 'true'
uses: ./.github/workflows/build-windows.yml
with:
version: ${{ needs.detect.outputs.version }}
hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }}
save_ccache: true
warm-macos-arm64-deps:
needs: detect
if: needs.detect.outputs.macos_arm64 == 'true'
runs-on: macos-15
timeout-minutes: 40
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/warm-macos-deps
with:
arch: arm64
runner: macos-15
deployment_target: "11.0"
hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }}
warm-macos-x86_64-deps:
needs: detect
if: needs.detect.outputs.macos_x86_64 == 'true'
runs-on: macos-15-intel
timeout-minutes: 100
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/warm-macos-deps
with:
arch: x86_64
runner: macos-15-intel
deployment_target: "10.13"
hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }}
warm-macos-arm64-ccache:
needs: [detect, warm-macos-arm64-deps]
if: needs.detect.outputs.macos_arm64 == 'true'
uses: ./.github/workflows/build-macos.yml
with:
version: ${{ needs.detect.outputs.version }}
hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }}
arch: arm64
runner: macos-15
deployment_target: "11.0"
save_ccache: true
warm-macos-x86_64-ccache:
needs: [detect, warm-macos-x86_64-deps]
if: needs.detect.outputs.macos_x86_64 == 'true'
uses: ./.github/workflows/build-macos.yml
with:
version: ${{ needs.detect.outputs.version }}
hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }}
arch: x86_64
runner: macos-15-intel
deployment_target: "10.13"
save_ccache: true
|