Repository navigation
241 lines (235 loc) · 10.4 KB
/
Copy pathstaging-qualification.yml
File metadata and controls
241 lines (235 loc) · 10.4 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
name: Staging Release Qualification
on:
workflow_dispatch:
inputs:
installation:
description: Configured staging installation ID
required: true
type: string
source_sha:
description: Full main source SHA of the published release
required: true
type: string
publication_run_id:
description: Successful Enterprise Containers publication run ID
required: true
type: string
publication_attempt:
description: Exact successful publication attempt
required: true
type: string
previous_source_sha:
description: Previous main source for sign-in pair preparation (supply all three previous inputs)
required: false
type: string
previous_publication_run_id:
description: Publication run for the previous source
required: false
type: string
previous_publication_attempt:
description: Exact previous publication attempt
required: false
type: string
rehearse_signin:
description: Install the prepared controller pair on a disposable hosted runner and verify sign-in across replacements
required: false
type: boolean
default: false
permissions:
contents: read
actions: read
concurrency:
group: staging-qualification-${{ inputs.installation }}
cancel-in-progress: false
jobs:
qualify:
if: >-
github.repository == 'openclaw/openclaw-enterprise' && github.ref == 'refs/heads/main' &&
!inputs.rehearse_signin && inputs.previous_source_sha == '' && inputs.previous_publication_run_id == '' && inputs.previous_publication_attempt == ''
permissions:
contents: read
actions: read
packages: read
runs-on: ubuntu-24.04
timeout-minutes: 60
environment: staging-qualification
env:
CI: "1"
STAGING_INSTALLATION: ${{ inputs.installation }}
CONFIGURED_STAGING_INSTALLATION: ${{ vars.STAGING_INSTALLATION }}
SOURCE_SHA: ${{ inputs.source_sha }}
PUBLICATION_RUN_ID: ${{ inputs.publication_run_id }}
PUBLICATION_ATTEMPT: ${{ inputs.publication_attempt }}
GHCR_CONTROLLER_IMAGE: ${{ vars.GHCR_CONTROLLER_IMAGE }}
GHCR_RUNTIME_IMAGE: ${{ vars.GHCR_RUNTIME_IMAGE }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.workflow_sha }}
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: "24.22.1"
package-manager-cache: false
- name: Validate trusted publication producer
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/ci/staging-qualification.ts validate
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: container-publication-${{ inputs.publication_run_id }}-${{ inputs.publication_attempt }}
repository: openclaw/openclaw-enterprise
run-id: ${{ inputs.publication_run_id }}
github-token: ${{ github.token }}
path: ${{ runner.temp }}/publication
skip-decompress: true
digest-mismatch: error
- name: Verify release inputs and pull immutable images
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/ci/staging-qualification.ts pull "$RUNNER_TEMP/publication"
- name: Install trusted smoke test prerequisites
run: |
bash scripts/ci/setup-tools.sh k3d
corepack pnpm install --frozen-lockfile --ignore-scripts
- name: Run trusted startup tests against the release images
id: smoke
run: node scripts/ci/staging-qualification.ts smoke
- name: Clean up interrupted smoke resources
if: always() && steps.smoke.outcome && steps.smoke.outcome != 'success' && steps.smoke.outcome != 'skipped'
run: node scripts/ci/cleanup.ts --state "$RUNNER_TEMP/staging-runtime-state.json"
- name: Retain qualification evidence
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: staging-qualification-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/staging-pulled-images.json
${{ runner.temp }}/staging-images-packaging.json
${{ runner.temp }}/staging-images-runtime-startup.json
${{ runner.temp }}/staging-qualification.json
if-no-files-found: error
retention-days: 7
stage-pair:
name: ${{ inputs.rehearse_signin && 'Rehearse installed sign-in on a disposable cluster' || 'Prepare controller pair inputs (no installation)' }}
if: >-
github.repository == 'openclaw/openclaw-enterprise' && github.ref == 'refs/heads/main' &&
(inputs.rehearse_signin || inputs.previous_source_sha != '' || inputs.previous_publication_run_id != '' || inputs.previous_publication_attempt != '')
permissions:
contents: read
actions: read
packages: read
runs-on: ubuntu-24.04
timeout-minutes: ${{ inputs.rehearse_signin && 120 || 60 }}
environment: staging-qualification
env:
CI: "1"
STAGING_INSTALLATION: ${{ inputs.installation }}
CONFIGURED_STAGING_INSTALLATION: ${{ vars.STAGING_INSTALLATION }}
SOURCE_SHA: ${{ inputs.source_sha }}
PUBLICATION_RUN_ID: ${{ inputs.publication_run_id }}
PUBLICATION_ATTEMPT: ${{ inputs.publication_attempt }}
GHCR_CONTROLLER_IMAGE: ${{ vars.GHCR_CONTROLLER_IMAGE }}
GHCR_RUNTIME_IMAGE: ${{ vars.GHCR_RUNTIME_IMAGE }}
PREVIOUS_SOURCE_SHA: ${{ inputs.previous_source_sha }}
PREVIOUS_PUBLICATION_RUN_ID: ${{ inputs.previous_publication_run_id }}
PREVIOUS_PUBLICATION_ATTEMPT: ${{ inputs.previous_publication_attempt }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.workflow_sha }}
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: "24.22.1"
package-manager-cache: false
- name: Validate both publication producers and their order
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/ci/staging-qualification.ts validate-pair
- name: Download the previous publication receipt
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: container-publication-${{ inputs.previous_publication_run_id }}-${{ inputs.previous_publication_attempt }}
repository: openclaw/openclaw-enterprise
run-id: ${{ inputs.previous_publication_run_id }}
github-token: ${{ github.token }}
path: ${{ runner.temp }}/previous-publication
skip-decompress: true
digest-mismatch: error
- name: Download the candidate publication receipt
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: container-publication-${{ inputs.publication_run_id }}-${{ inputs.publication_attempt }}
repository: openclaw/openclaw-enterprise
run-id: ${{ inputs.publication_run_id }}
github-token: ${{ github.token }}
path: ${{ runner.temp }}/candidate-publication
skip-decompress: true
digest-mismatch: error
- uses: ./.github/actions/setup-test-docker
with:
setup-buildx: "false"
- name: Stage both controllers and the incumbent runtime and bind the sign-in plan
id: pair
env:
GH_TOKEN: ${{ github.token }}
run: |
plan=$(node scripts/ci/staging-qualification.ts prepare-signin "$RUNNER_TEMP/previous-publication" "$RUNNER_TEMP/candidate-publication")
[[ "$plan" =~ ^[0-9a-f]{64}$ ]]
printf '%s\n' "$plan"
printf 'plan=%s\n' "$plan" >> "$GITHUB_OUTPUT"
- name: Retain verified pair inputs
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: staging-pair-inputs-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/staging-pair-images.json
${{ runner.temp }}/staging-signin-plan.json
if-no-files-found: error
retention-days: 7
- name: Select the repository Go toolchain for the installed fixture
if: inputs.rehearse_signin
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e
with:
go-version-file: go.mod
- name: Prepare trusted tools and dependencies
if: inputs.rehearse_signin
run: |
bash scripts/ci/setup-tools.sh k3d
corepack pnpm install --frozen-lockfile --ignore-scripts
corepack pnpm build
go mod download
- name: Prepare the owned sign-in cluster
if: inputs.rehearse_signin
id: installed
env:
PLAN: ${{ steps.pair.outputs.plan }}
run: |
prepared=$(node scripts/ci/prepare-staged-signin.ts "$PLAN")
[[ "$prepared" =~ ^[0-9a-f]{64}$ ]]
printf 'prepared=%s\n' "$prepared" >> "$GITHUB_OUTPUT"
- name: Run the fixed sign-in case under descendant supervision
if: inputs.rehearse_signin
id: signin
env:
OCC_TEST_SIGNIN_PLAN_SHA256: ${{ steps.pair.outputs.plan }}
OCC_TEST_SIGNIN_PREPARED_SHA256: ${{ steps.installed.outputs.prepared }}
run: GOMODCACHE="$(go env GOMODCACHE)" python3 -I scripts/ci/staged-signin-settle.py
- name: Verify settlement, release owned resources and record the outcome
if: always() && inputs.rehearse_signin && steps.installed.outcome == 'success' && (steps.signin.outcome == 'success' || steps.signin.outcome == 'failure')
id: finish
env:
PLAN: ${{ steps.pair.outputs.plan }}
PREPARED: ${{ steps.installed.outputs.prepared }}
run: node scripts/ci/cleanup-staged-signin.ts "$PLAN" "$PREPARED"
- name: Retain the installed rehearsal qualification
if: inputs.rehearse_signin && steps.finish.outcome == 'success'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: staging-signin-qualification-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/staging-signin-qualification.json
if-no-files-found: error
retention-days: 7