66 pull_request :
77 workflow_dispatch :
88
9+ permissions :
10+ contents : read
11+ packages : write
12+
913jobs :
14+ lint :
15+ name : lint
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v4
19+ - uses : actions/setup-go@v5
20+ with :
21+ go-version-file : go.mod
22+ cache : true
23+ - name : Run linters
24+ run : make lint
25+
1026 envtest :
1127 name : envtest controller
1228 runs-on : ubuntu-latest
29+ needs : [lint]
1330 steps :
1431 - uses : actions/checkout@v4
1532 - uses : actions/setup-go@v5
@@ -25,22 +42,77 @@ jobs:
2542 name : envtest-reports
2643 path : reports/
2744
45+ release-artifact :
46+ name : install artifact reproducibility
47+ runs-on : ubuntu-latest
48+ steps :
49+ - uses : actions/checkout@v4
50+ - uses : actions/setup-go@v5
51+ with :
52+ go-version-file : go.mod
53+ cache : true
54+ - name : Build reproducible install artifact
55+ run : make rc-artifacts VERSION=ci IMG=ghcr.io/${{ github.repository }}/smolvm-operator:${{ github.sha }} RUNTIME_IMG=ghcr.io/${{ github.repository }}/smolvm-runtime:${{ github.sha }}
56+ - name : Upload install artifact
57+ uses : actions/upload-artifact@v4
58+ with :
59+ name : install-artifact
60+ path : dist/
61+
62+ container-images :
63+ name : immutable container images
64+ runs-on : ubuntu-latest
65+ if : github.event_name != 'pull_request'
66+ steps :
67+ - uses : actions/checkout@v4
68+ - uses : docker/login-action@v3
69+ with :
70+ registry : ghcr.io
71+ username : ${{ github.actor }}
72+ password : ${{ secrets.GITHUB_TOKEN }}
73+ - name : Build and publish immutable images
74+ run : |
75+ docker build -t ghcr.io/${{ github.repository }}/smolvm-operator:${{ github.sha }} .
76+ docker build -f Dockerfile.runtime --build-arg SMOLVM_VERSION=0.8.1 -t ghcr.io/${{ github.repository }}/smolvm-runtime:${{ github.sha }} .
77+ docker push ghcr.io/${{ github.repository }}/smolvm-operator:${{ github.sha }}
78+ docker push ghcr.io/${{ github.repository }}/smolvm-runtime:${{ github.sha }}
79+
2880 kind-e2e :
2981 name : kind topology e2e
3082 runs-on : ubuntu-latest
83+ needs : [envtest, release-artifact]
3184 steps :
3285 - uses : actions/checkout@v4
3386 - uses : actions/setup-go@v5
3487 with :
3588 go-version-file : go.mod
3689 cache : true
90+ - name : Prepare KVM-backed multi-node kind mounts
91+ run : |
92+ set -euxo pipefail
93+ test -e /dev/kvm
94+ sudo chmod 666 /dev/kvm
95+ for node in control-plane worker worker2; do
96+ sudo mkdir -p "/tmp/smolvm-kind-${node}-var-lib" "/tmp/smolvm-kind-${node}-var-run"
97+ sudo chmod 777 "/tmp/smolvm-kind-${node}-var-lib" "/tmp/smolvm-kind-${node}-var-run"
98+ done
99+ - name : Build e2e images and manifest
100+ run : |
101+ docker build -t smolvm-operator:e2e .
102+ docker build -f Dockerfile.runtime --build-arg SMOLVM_VERSION=0.8.1 -t smolvm-runtime:e2e .
103+ make build-installer IMG=smolvm-operator:e2e RUNTIME_IMG=smolvm-runtime:e2e
37104 - uses : helm/kind-action@v1
38105 with :
39106 cluster_name : kind
40- - name : Run deployed-topology e2e test
107+ config : .github/kind-kvm-multinode-config.yaml
108+ - name : Load e2e images
109+ run : |
110+ kind load docker-image smolvm-operator:e2e --name kind
111+ kind load docker-image smolvm-runtime:e2e --name kind
112+ - name : Run deployed topology e2e
41113 env :
42114 RUN_E2E : " true"
43- KIND_CLUSTER : kind
115+ E2E_INSTALL_MANIFEST : dist/install.yaml
44116 run : make test-e2e-report
45117 - name : Upload e2e reports
46118 if : always()
@@ -52,33 +124,106 @@ jobs:
52124 smolvm-runtime-e2e :
53125 name : smolvm runtime lifecycle e2e
54126 runs-on : ubuntu-latest
127+ needs : [envtest, release-artifact]
55128 timeout-minutes : 45
56129 steps :
57130 - uses : actions/checkout@v4
58131 - uses : actions/setup-go@v5
59132 with :
60133 go-version-file : go.mod
61134 cache : true
62- - name : Prepare KVM-backed kind mounts
135+ - name : Prepare KVM-backed multi-node kind mounts
63136 run : |
64137 set -euxo pipefail
65138 test -e /dev/kvm
66139 sudo chmod 666 /dev/kvm
67- sudo mkdir -p /tmp/smolvm-kind-var-lib /tmp/smolvm-kind-var-run
68- sudo chmod 777 /tmp/smolvm-kind-var-lib /tmp/smolvm-kind-var-run
140+ for node in control-plane worker worker2; do
141+ sudo mkdir -p "/tmp/smolvm-kind-${node}-var-lib" "/tmp/smolvm-kind-${node}-var-run"
142+ sudo chmod 777 "/tmp/smolvm-kind-${node}-var-lib" "/tmp/smolvm-kind-${node}-var-run"
143+ done
144+ - name : Build runtime e2e images and manifest
145+ run : |
146+ docker build -t smolvm-operator:runtime-e2e .
147+ docker build -f Dockerfile.runtime --build-arg SMOLVM_VERSION=0.8.1 -t smolvm-runtime:runtime-e2e .
148+ make build-installer IMG=smolvm-operator:runtime-e2e RUNTIME_IMG=smolvm-runtime:runtime-e2e
69149 - uses : helm/kind-action@v1
70150 with :
71151 cluster_name : runtime
72- config : .github/kind-runtime-config.yaml
152+ config : .github/kind-kvm-multinode-config.yaml
153+ - name : Load runtime e2e images
154+ run : |
155+ kind load docker-image smolvm-operator:runtime-e2e --name runtime
156+ kind load docker-image smolvm-runtime:runtime-e2e --name runtime
73157 - name : Run runtime lifecycle e2e
74158 env :
75159 RUN_E2E : " true"
76- KIND_CLUSTER : runtime
160+ E2E_INSTALL_MANIFEST : dist/install.yaml
77161 RUNTIME_E2E : " true"
162+ KIND_CLUSTER : runtime
78163 run : make test-runtime-e2e-report
79164 - name : Upload runtime logs
80165 if : always()
81166 uses : actions/upload-artifact@v4
82167 with :
83168 name : runtime-e2e-logs
84169 path : reports/
170+
171+ release-hardening-e2e :
172+ name : upgrade multi-node and failure gates
173+ runs-on : ubuntu-latest
174+ needs : [envtest, release-artifact]
175+ if : ${{ vars.PREVIOUS_INSTALL_MANIFEST_URL != '' }}
176+ steps :
177+ - uses : actions/checkout@v4
178+ - uses : actions/setup-go@v5
179+ with :
180+ go-version-file : go.mod
181+ cache : true
182+ - name : Prepare KVM-backed multi-node kind mounts
183+ run : |
184+ set -euxo pipefail
185+ test -e /dev/kvm
186+ sudo chmod 666 /dev/kvm
187+ for node in control-plane worker worker2; do
188+ sudo mkdir -p "/tmp/smolvm-kind-${node}-var-lib" "/tmp/smolvm-kind-${node}-var-run"
189+ sudo chmod 777 "/tmp/smolvm-kind-${node}-var-lib" "/tmp/smolvm-kind-${node}-var-run"
190+ done
191+ - name : Build hardening e2e images and manifests
192+ env :
193+ PREVIOUS_INSTALL_MANIFEST_URL : ${{ vars.PREVIOUS_INSTALL_MANIFEST_URL }}
194+ run : |
195+ set -euxo pipefail
196+ if [ -z "$PREVIOUS_INSTALL_MANIFEST_URL" ]; then
197+ echo "PREVIOUS_INSTALL_MANIFEST_URL repository variable is required for upgrade e2e" >&2
198+ exit 1
199+ fi
200+ mkdir -p dist
201+ curl -fsSL "$PREVIOUS_INSTALL_MANIFEST_URL" -o dist/previous-install.yaml
202+ docker build -t smolvm-operator:rc .
203+ docker build -f Dockerfile.runtime --build-arg SMOLVM_VERSION=0.8.1 -t smolvm-runtime:rc .
204+ make build-installer IMG=smolvm-operator:rc RUNTIME_IMG=smolvm-runtime:rc
205+ cp dist/install.yaml dist/rc-install.yaml
206+ - uses : helm/kind-action@v1
207+ with :
208+ cluster_name : hardening
209+ config : .github/kind-kvm-multinode-config.yaml
210+ - name : Load hardening images
211+ run : |
212+ kind load docker-image smolvm-operator:rc --name hardening
213+ kind load docker-image smolvm-runtime:rc --name hardening
214+ - name : Run upgrade, multi-node, and failure checks
215+ env :
216+ RUN_E2E : " true"
217+ E2E_INSTALL_MANIFEST : dist/rc-install.yaml
218+ PREVIOUS_INSTALL_MANIFEST : dist/previous-install.yaml
219+ RC_INSTALL_MANIFEST : dist/rc-install.yaml
220+ run : |
221+ make test-upgrade-e2e-report
222+ make test-multinode-e2e-report
223+ make test-failure-e2e-report
224+ - name : Upload release hardening reports
225+ if : always()
226+ uses : actions/upload-artifact@v4
227+ with :
228+ name : release-hardening-reports
229+ path : reports/
0 commit comments