-
Notifications
You must be signed in to change notification settings - Fork 56
270 lines (259 loc) · 9.8 KB
/
Copy pathci.yml
File metadata and controls
270 lines (259 loc) · 9.8 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
name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
env:
JEST_JUNIT_OUTPUT_DIR: ./coverage/junit/
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.16.0
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build
- name: Upload workspace
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: workspace
path: .
retention-days: 1
validate:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.16.0
cache: 'yarn'
- name: Download workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: workspace
path: .
- name: Install dependencies
run: yarn install --immutable
- name: Locale verify
run: yarn run locale:verify
- name: Lint
run: yarn run lint
- name: Run unit tests and publish to codeclimate
env:
JEST_JUNIT_OUTPUT_DIR: ./coverage/junit/
run: yarn test:unit --coverage
- name: Store junit results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: junit
path: coverage/junit
- name: Publish junit test report
if: ${{ always() && hashFiles('coverage/junit/*.xml') != '' }}
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3
with:
name: Unit Tests
path: coverage/junit/*.xml
reporter: jest-junit
fail-on-error: false
test-integration:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.16.0
cache: 'yarn'
- name: Download workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: workspace
path: .
- name: Install dependencies
run: yarn install --immutable
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Test component
env:
PLAYWRIGHT_JUNIT_OUTPUT_NAME: component-junit.xml
run: yarn run test:component
- name: Publish component test report
if: ${{ always() && hashFiles('test-results/component-junit.xml') != '' }}
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3
with:
name: Component Tests
path: test-results/component-junit.xml
reporter: jest-junit
fail-on-error: false
- name: Test mashup
run: yarn run test:mashup
- name: Store mashup artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: mashup
path: ./test/mashup
- name: Publish mashup test report
if: ${{ always() && hashFiles('test/mashup/reports/xml/*.xml') != '' }}
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3
with:
name: Mashup Tests
path: test/mashup/reports/xml/*.xml
reporter: jest-junit
fail-on-error: false
- name: Test integration
env:
PLAYWRIGHT_JUNIT_OUTPUT_NAME: integration-junit.xml
run: yarn run test:integration
- name: Publish integration test report
if: ${{ always() && hashFiles('test-results/integration-junit.xml') != '' }}
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3
with:
name: Integration Tests
path: test-results/integration-junit.xml
reporter: jest-junit
fail-on-error: false
- name: Test rendering
run: yarn run test:rendering
- name: Store rendering artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: rendering
path: ./test/rendering
- name: Publish rendering test report
if: ${{ always() && hashFiles('test/rendering/reports/xml/*.xml') != '' }}
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3
with:
name: Rendering Tests
path: test/rendering/reports/xml/*.xml
reporter: jest-junit
fail-on-error: false
- name: Test visual (serve /dev route)
env:
SERVE_TEST_PORT: 8700
CI: 'true'
# --update-snapshots=missing writes baselines that don't exist yet
# (first run on a new platform) without overwriting existing ones.
# Existing baselines are still compared normally, so regressions fail.
run: npx playwright test --config=./commands/serve/test/playwright.config.js --update-snapshots=missing
- name: Upload visual snapshots
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: visual-snapshots
# Upload the full snapshot directory so newly-generated linux baselines
# (*-linux.png) can be downloaded, reviewed, and committed to the repo.
path: commands/serve/test/e2e/dev-route.spec.js-snapshots
test-create:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.16.0
cache: 'yarn'
- name: Download workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: workspace
path: .
- name: Install dependencies
run: yarn install --immutable
- run: chmod +x .github/scripts/nebula_create.sh
- name: Create Nebula visualization project (Picasso)
run: .github/scripts/nebula_create.sh generated/hello none false false true true
- name: Create Nebula visualization project (Barchart)
run: .github/scripts/nebula_create.sh generated/barchart barchart false false true true
- name: Create Nebula mashup project
run: .github/scripts/nebula_create.sh generated/hello-mashup none true true true false
- name: Store barchart screenshots
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: barchart-screenshots
path: generated/barchart/screenshots
- name: Store mashup artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: mashup-artifacts
path: test/mashup/__artifacts__
api-governance:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.16.0
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Create version.txt
id: version
run: |
set -x
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
version=${GITHUB_REF_NAME#v}
else
yarn workspace "@nebula.js/stardust" version preminor
yarn spec
version=$(node -p "require('./apis/stardust/api-spec/spec.json').info.version")
fi
echo "$version" > ./version.txt
echo "version=$version" >> $GITHUB_OUTPUT
echo "Building $version"
- name: Prepare API Compliance
run: |
docker pull ghcr.io/qlik-download/api-compliance
docker create -v /specs --name specs alpine:3.4 /bin/true
docker cp ./apis/stardust/api-spec/spec.json specs:/specs
docker cp ./apis/stardust/api-spec/listbox-spec.json specs:/specs
- name: Run API Compliance
env:
CREDENTIALS_S3_SECRETKEY: ${{ secrets.APICULTURIST_S3 }}
CREDENTIALS_GITHUB: ${{ secrets.APICULTURIST_GITHUB }}
CREDENTIALS_COLONY: ${{ secrets.APICULTURIST_TOKEN }}
COMMIT_SHA: ${{ github.sha }}
VER: v${{ steps.version.outputs.version }}
run: |
docker run --volumes-from specs \
-e SPEC_PATHS="abdc47c2-921a-45d3-ba5c-80d448574c5b@/specs/spec.json,ba0bcf91-d7a6-4048-a36a-ad9a2dc8c03e@/specs/listbox-spec.json" \
-e COMMIT_SHA="$COMMIT_SHA" \
-e RELEASE_TAG="$VER" \
-e PRE_RELEASE="true" \
-e CREDENTIALS_S3_SECRETKEY="$CREDENTIALS_S3_SECRETKEY" \
-e CREDENTIALS_GITHUB="$CREDENTIALS_GITHUB" \
-e CREDENTIALS_COLONY="$CREDENTIALS_COLONY" \
ghcr.io/qlik-download/api-compliance