-
Notifications
You must be signed in to change notification settings - Fork 5
667 lines (570 loc) · 22.6 KB
/
Copy pathci.yml
File metadata and controls
667 lines (570 loc) · 22.6 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
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
name: LAPIS-SILO
on:
push:
branches:
- main
pull_request:
env:
DOCKER_DEPENDENCY_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo-dependencies
DOCKER_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo
jobs:
release-please:
concurrency:
group: lapis-silo-release-please-${{ github.ref }}
cancel-in-progress: false
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@v5
if: github.event_name == 'push'
id: release
with:
path: .
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
target-branch: main
- name: Inspect Release Outputs
if: github.event_name == 'push'
run: |
cat <<'EOF'
${{ toJson(steps.release.outputs) }}
EOF
- uses: actions/checkout@v7
if: >-
github.event_name == 'push'
&& steps.release.outputs.prs_created == 'true'
with:
fetch-depth: 0
- name: Annotate changelog with serialization version change
if: >-
github.event_name == 'push'
&& steps.release.outputs.prs_created == 'true'
run: |
set -euo pipefail
# PR_JSON is passed via the environment (see env: below) rather than
# interpolated into the script, so single quotes or other shell
# metacharacters in the payload cannot break parsing or inject commands.
BRANCH=$(echo "$PR_JSON" | jq -r '.headBranchName // empty')
VERSION=$(echo "$PR_JSON" | jq -r '.title // empty' | grep -oP '\d+\.\d+\.\d+' || true)
if [ -z "$BRANCH" ] || [ -z "$VERSION" ]; then
echo "Could not determine branch ($BRANCH) or version ($VERSION), skipping"
exit 0
fi
git fetch origin "$BRANCH"
git checkout -B "$BRANCH" "origin/$BRANCH"
./.github/scripts/annotate-changelog-serialization-version.sh \
--version="$VERSION"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_JSON: ${{ steps.release.outputs.pr }}
- uses: actions/checkout@v7
if: >-
github.event_name == 'push'
&& steps.release.outputs.release_created == 'true'
with:
fetch-depth: 0
- name: Annotate GitHub release with serialization version change
if: >-
github.event_name == 'push'
&& steps.release.outputs.release_created == 'true'
run: |
./.github/scripts/annotate-release-serialization-version.sh \
--tag="${{ steps.release.outputs.tag_name }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dependencyImage:
name: Build dependency image (${{ matrix.arch }})
strategy:
matrix:
arch: ["amd64", "arm64"]
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-latest' }}
permissions:
packages: write
steps:
- uses: actions/checkout@v7
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Generate dependency files hash
run: |
DIR_HASH=$(echo -n ${{ hashFiles('conanfile.py', 'buildScripts/install-dependencies', 'buildScripts/create-conanprofile', './Dockerfile_dependencies') }})
echo "DIR_HASH=$DIR_HASH" >> $GITHUB_ENV
- name: Check if dependency image exists
run: |
EXISTS=$(docker manifest inspect \
${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:filehash-${{ env.DIR_HASH }}-${{ matrix.arch }} > /dev/null 2>&1 &&
echo "true" || echo "false")
echo "CACHE_HIT=$EXISTS" >> $GITHUB_ENV
- name: Build and push dependency image if input files changed
if: env.CACHE_HIT == 'false'
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile_dependencies
push: true
tags: ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:filehash-${{ env.DIR_HASH }}-${{ matrix.arch }}
cache-from: type=gha,ref=dependency-image-cache-${{ matrix.arch }}-${{ hashFiles('conanfile.py', 'Dockerfile_dependencies') }}
cache-to: type=gha,mode=min,ref=dependency-image-cache-${{ hashFiles('conanfile.py', 'Dockerfile_dependencies') }}
- name: Tag dependency image with commit hash
run: |
docker buildx imagetools create \
--tag ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-${{ matrix.arch }} \
${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:filehash-${{ env.DIR_HASH }}-${{ matrix.arch }}
formatting:
name: Formatting Check
needs: dependencyImage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Check formatting
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64 \
bash --login -c "make check-format"
dockerImage:
name: Build docker images
needs: [dependencyImage, release-please]
strategy:
matrix:
arch: ["amd64", "arm64"]
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-latest' }}
permissions:
packages: write
steps:
- uses: actions/checkout@v7
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Write release_version.txt
run: |
git fetch origin 'refs/tags/*:refs/tags/*'
echo "Available tags:"
git tag -l
if git describe --tags --exact-match >/dev/null 2>&1; then
echo "Using release version from git tag"
VERSION=$(git describe --tags --exact-match | sed 's/^v//')
else
echo "Using release version from commit hash"
VERSION="${{ env.HEAD_SHA }}"
fi
echo "Using release version: $VERSION"
echo "$VERSION" > release_version.txt
- name: Build unit test image
uses: docker/build-push-action@v7
with:
context: .
target: builder
tags: builder
load: true
cache-from: type=gha,ref=image-cache-${{ github.ref_name }}-${{ matrix.arch }}
cache-to: type=gha,mode=min,ref=image-cache-${{ github.ref_name }}-${{ matrix.arch }}
build-args: |
DEPENDENCY_IMAGE=${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-${{ matrix.arch }}
- name: Run unit tests
run: |
docker run \
--entrypoint "./silo_test" \
builder
docker run \
--entrypoint "./silo_app_test" \
builder
- name: Build and push production image
uses: docker/build-push-action@v7
with:
context: .
push: true
cache-from: type=gha,ref=image-cache-${{ github.ref_name }}-${{ matrix.arch }}
cache-to: type=gha,mode=min,ref=image-cache-${{ github.ref_name }}-${{ matrix.arch }}
tags: ${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-${{ matrix.arch }}
build-args: |
DEPENDENCY_IMAGE=${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-${{ matrix.arch }}
multiPlatformImages:
name: Create multi-platform images
needs: dockerImage
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v7
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Determine whether to use a release version
run: |
git fetch origin 'refs/tags/*:refs/tags/*'
echo "Available tags:"
git tag -l
if git describe --tags --exact-match >/dev/null 2>&1; then
echo "Using release version from git tag"
VERSION=$(git describe --tags --exact-match | sed 's/^v//')
echo "SILO_VERSION=${VERSION}" >> $GITHUB_ENV
fi
- name: Docker metadata
id: dockerMetadataImage
uses: docker/metadata-action@v6
with:
images: ${{ env.DOCKER_IMAGE_NAME }}
tags: |
type=ref,event=pr
type=raw,value=${{ github.head_ref || github.ref_name }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=commit-${{ env.HEAD_SHA }}
type=semver,value=${{ env.SILO_VERSION }},enable=${{ env.SILO_VERSION != '' }},pattern={{version}}
type=semver,value=${{ env.SILO_VERSION }},enable=${{ env.SILO_VERSION != '' }},pattern={{major}}.{{minor}}
- name: Tag images
run: |
TAGS=(${{ steps.dockerMetadataImage.outputs.tags }})
for TAG in "${TAGS[@]}"; do
docker buildx imagetools create --tag $TAG \
"${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-arm64" \
"${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64"
done
- name: Extract binaries for release
if: env.SILO_VERSION != ''
run: |
echo "Extracting binaries for version ${{ env.SILO_VERSION }}"
mkdir -p artifacts
cd artifacts
for arch in amd64 arm64; do
IMAGE="${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-$arch"
PLATFORM="linux/$arch"
echo "Extracting from $IMAGE ($PLATFORM)"
binary="silo-linux-$arch"
docker create --platform $PLATFORM --name extract-$arch $IMAGE
docker cp extract-$arch:/app/silo "./$binary"
docker rm extract-$arch
chmod +x "./$binary"
echo "Verifying $binary ..."
[ -x "$binary" ] || { echo " ✗ FAILED: File does not exist or is not executable"; exit 1; }
file "$binary" | grep -q ELF || { echo " ✗ FAILED: File is not an ELF binary"; exit 1; }
echo "✓ Verified: $binary"
sha256sum "$binary" > "$binary.sha256sum"
# Create tar archive so that the file is executable when downloaded from GitHub Releases
tar -czf "$binary.tar.gz" "$binary"
done
echo "Files in artifacts/ after extraction:"
ls -alh .
- name: Upload binaries to GitHub Release
if: env.SILO_VERSION != ''
uses: softprops/action-gh-release@v3
with:
files: |
artifacts/*.tar.gz
artifacts/*.sha256sum
tag_name: v${{ env.SILO_VERSION }}
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
endToEndTests:
name: Run End To End Tests
needs: dockerImage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7.0.0
with:
node-version: 18.x
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- uses: actions/cache@v6
with:
path: ~/.npm
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}"
- name: npm install
run: cd endToEndTests && npm ci
- name: Start Docker Container and preprocess data
run: docker compose -f docker-compose-for-tests-preprocessing-from-ndjson.yml up
env:
SILO_IMAGE: ${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64
- name: Start Docker Container and run api
run: docker compose -f docker-compose-for-tests-api.yml up -d --wait
env:
SILO_IMAGE: ${{ env.DOCKER_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64
- name: Run Tests
run: cd endToEndTests && SILO_URL=localhost:8080 npm run test
linterChanges:
name: Build/Run linter on changed files
needs: dependencyImage
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Run linter script
run: buildScripts/lint-changes ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64
linterAll:
name: Build/Run linter on all files
needs: dependencyImage
if: >-
github.event_name == 'push' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'trigger-linter'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Build all files with clang-tidy
run: buildScripts/lint-all ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64
unitTests:
needs: dependencyImage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Run tests in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64 \
bash --login -c "mv /src/conanprofile . && make test"
pythonTests:
needs: dependencyImage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Run Python tests in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-amd64 \
bash --login -c "mv /src/conanprofile . && mv /src/build . && make python-tests"
buildWheelsLinux:
name: Build wheel (linux-${{ matrix.arch }})
needs: [dependencyImage, release-please]
strategy:
matrix:
arch: ["amd64", "arm64"]
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-latest' }}
permissions:
contents: write
packages: read
steps:
- uses: actions/checkout@v7
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Build wheels in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ env.HEAD_SHA }}-${{ matrix.arch }} \
bash --login -c "
set -euo pipefail
mv /src/conanprofile .
# Build the C++ project once
export CMAKE_BUILD_PARALLEL_LEVEL=4
make build/Release/silo
# Build wheels for all supported Python versions
mkdir -p wheelhouse
for pyversion in 3.11 3.12 3.13 3.14; do
uv python install \$pyversion
rm -rf dist
uv build --wheel --python \$pyversion
uv tool run auditwheel repair dist/*.whl -w wheelhouse/
done
"
- name: Upload wheel as workflow artifact
uses: actions/upload-artifact@v7
with:
name: wheel-linux-${{ matrix.arch }}
path: wheelhouse/*.whl
- name: Determine release version
run: |
git fetch origin 'refs/tags/*:refs/tags/*'
if git describe --tags --exact-match >/dev/null 2>&1; then
VERSION=$(git describe --tags --exact-match | sed 's/^v//')
echo "SILO_VERSION=${VERSION}" >> $GITHUB_ENV
fi
- name: Upload wheel to GitHub release
if: env.SILO_VERSION != ''
uses: softprops/action-gh-release@v3
with:
files: wheelhouse/*.whl
tag_name: v${{ env.SILO_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
buildWheelsMacos:
name: Build wheel (macos-${{ matrix.arch }})
needs: release-please
strategy:
matrix:
include:
- runner: macos-15
arch: arm64
- runner: macos-15-intel
arch: x86_64
runs-on: ${{ matrix.runner }}
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
- name: Install Conan
run: uv tool install conan
- name: Cache Conan packages
uses: actions/cache@v6
with:
path: ~/.conan2
key: conan-macos-${{ matrix.arch }}-${{ hashFiles('conanfile.py', 'Dockerfile_dependencies') }}
restore-keys: |
conan-macos-${{ matrix.arch }}-
- name: Build wheels for all supported Python versions
run: make build-wheels
- name: Upload wheel as workflow artifact
uses: actions/upload-artifact@v7
with:
name: wheel-macos-${{ matrix.arch }}
path: wheelhouse/*.whl
- name: Determine release version
run: |
git fetch origin 'refs/tags/*:refs/tags/*'
if git describe --tags --exact-match >/dev/null 2>&1; then
VERSION=$(git describe --tags --exact-match | sed 's/^v//')
echo "SILO_VERSION=${VERSION}" >> $GITHUB_ENV
fi
- name: Upload wheel to GitHub release
if: env.SILO_VERSION != ''
uses: softprops/action-gh-release@v3
with:
files: wheelhouse/*.whl
tag_name: v${{ env.SILO_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
wasmBuild:
name: Build WebAssembly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Must match the Emscripten version used to generate the Conan profile
# (see buildScripts/create-wasm-conanprofile).
- name: Set up Emscripten
uses: mymindstorm/setup-emsdk@v16
with:
version: 6.0.2
actions-cache-folder: emsdk-cache
# setup-emsdk prepends $EMSDK/upstream/emscripten to PATH, which contains
# a directory literally named `cmake` (Emscripten's own CMake Modules).
# GNU Make bypasses the shell for simple recipe lines and execs commands
# directly; on Linux this PATH search does not skip directory entries
# and does not fall back to later PATH entries after the resulting
# EACCES, so bare `cmake` invocations fail with "Permission denied"
# instead of finding the real cmake binary. Re-prioritize the system
# cmake's directory so it is found first again.
- name: Ensure system cmake takes priority over Emscripten's cmake/ directory
run: echo "$(dirname "$(command -v cmake)")" >> "$GITHUB_PATH"
- uses: astral-sh/setup-uv@v7
# The WASM dependencies (Arrow, Boost, ...) are compiled from source for
# Emscripten, which is slow. Cache the Conan package cache to avoid
# rebuilding them on every run.
- name: Cache Conan packages
uses: actions/cache@v6
with:
path: ~/.conan2
key: conan-wasm-${{ hashFiles('conanfile.py', 'buildScripts/install-wasm-dependencies', 'buildScripts/create-wasm-conanprofile') }}
restore-keys: |
conan-wasm-
- name: Use Node.js
uses: actions/setup-node@v7.0.0
with:
node-version: latest
- name: Build and test WASM target
run: make wasm-test
- name: Upload WASM artifacts
uses: actions/upload-artifact@v7
with:
name: silo-wasm
path: dist/wasm/*