-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (79 loc) · 2.98 KB
/
Copy pathci.yml
File metadata and controls
83 lines (79 loc) · 2.98 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
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
cache: npm
- run: npm ci
- name: Audit Node dependencies
run: npm audit --audit-level=high
- run: npm run check
- name: Verify committed Action bundle
run: git diff --exit-code -- dist
- name: Check shell scripts
run: shellcheck scripts/*.sh test/scripts/*.sh
- name: Verify reproducible image artifact
run: |
scripts/package-runner-image.sh
first="$(sha256sum build/runner-image.zip | awk '{print $1}')"
scripts/package-runner-image.sh
second="$(sha256sum build/runner-image.zip | awk '{print $1}')"
test "${first}" = "${second}"
runner-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Build ARM64 runner image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: runner-image
platforms: linux/arm64
tags: lambda-microvm-github-runner:test
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Scan runner image
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
with:
image: lambda-microvm-github-runner:test
fail-build: true
severity-cutoff: critical
only-fixed: true
output-format: table
- name: Verify immutable image contents
run: |
docker run --rm --platform linux/arm64 \
lambda-microvm-github-runner:test sh -lc '
set -e
! ldd /opt/actions-runner/bin/Runner.Listener | grep "not found"
test ! -S /var/run/docker.sock
/opt/actions-runner/bin/Runner.Listener --version
docker buildx version
docker compose version
aws --version
aws lambda-microvms help >/dev/null
for node_root in \
/opt/actions-runner/externals/node20 \
/opt/actions-runner/externals/node24; do
test "$("${node_root}/bin/node" \
"${node_root}/lib/node_modules/npm/bin/npm-cli.js" \
--version)" = "11.18.0"
test "$("${node_root}/bin/node" -p \
"require(\"${node_root}/lib/node_modules/npm/node_modules/tar/package.json\").version")" = \
"7.5.19"
done
'