1
name: Keycloak JavaScript CI
13
MAVEN_ARGS: "-B -nsu -Daether.connector.http.connectionMaxTtl=25"
16
# Only cancel jobs for PR updates
17
group: js-ci-${{ github.ref }}
18
cancel-in-progress: true
26
name: Check conditional workflows and jobs
27
runs-on: ubuntu-latest
29
js-ci: ${{ steps.conditional.outputs.js }}
31
- uses: actions/checkout@v4
34
uses: ./.github/actions/conditional
36
token: ${{ secrets.GITHUB_TOKEN }}
41
if: needs.conditional.outputs.js-ci == 'true'
42
runs-on: ubuntu-latest
44
- uses: actions/checkout@v4
47
uses: actions/setup-java@v4
54
- name: Build Keycloak
56
./mvnw clean install --errors -DskipTests -DskipTestsuite -DskipExamples -Pdistribution
57
mv ./quarkus/dist/target/keycloak-999.0.0-SNAPSHOT.tar.gz ./keycloak-999.0.0-SNAPSHOT.tar.gz
59
- name: Upload Keycloak dist
60
uses: actions/upload-artifact@v3
63
path: keycloak-999.0.0-SNAPSHOT.tar.gz
68
if: needs.conditional.outputs.js-ci == 'true'
69
runs-on: ubuntu-latest
71
WORKSPACE: "@keycloak/keycloak-admin-client"
73
- uses: actions/checkout@v4
75
- uses: ./.github/actions/pnpm-setup
79
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
82
- run: pnpm --filter ${{ env.WORKSPACE }} run build
88
if: needs.conditional.outputs.js-ci == 'true'
89
runs-on: ubuntu-latest
91
WORKSPACE: keycloak-js
93
- uses: actions/checkout@v4
95
- uses: ./.github/actions/pnpm-setup
99
- run: pnpm --filter ${{ env.WORKSPACE }} run build
100
working-directory: js
103
name: Keycloak Masthead
105
if: needs.conditional.outputs.js-ci == 'true'
106
runs-on: ubuntu-latest
108
WORKSPACE: keycloak-masthead
110
- uses: actions/checkout@v4
112
- uses: ./.github/actions/pnpm-setup
114
working-directory: js
116
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
117
working-directory: js
119
- run: pnpm --filter ${{ env.WORKSPACE }} run build
120
working-directory: js
125
if: needs.conditional.outputs.js-ci == 'true'
126
runs-on: ubuntu-latest
130
- uses: actions/checkout@v4
132
- uses: ./.github/actions/pnpm-setup
134
working-directory: js
136
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
137
working-directory: js
139
- run: pnpm --filter ${{ env.WORKSPACE }} run build
140
working-directory: js
145
if: needs.conditional.outputs.js-ci == 'true'
146
runs-on: ubuntu-latest
148
WORKSPACE: account-ui
150
- uses: actions/checkout@v4
152
- uses: ./.github/actions/pnpm-setup
154
working-directory: js
156
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
157
working-directory: js
159
- run: pnpm --filter ${{ env.WORKSPACE }} run build
160
working-directory: js
165
if: needs.conditional.outputs.js-ci == 'true'
166
runs-on: ubuntu-latest
170
- uses: actions/checkout@v4
172
- uses: ./.github/actions/pnpm-setup
174
working-directory: js
176
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
177
working-directory: js
179
- run: pnpm --filter ${{ env.WORKSPACE }} run test
180
working-directory: js
182
- run: pnpm --filter ${{ env.WORKSPACE }} run build
183
working-directory: js
185
- run: pnpm --filter ${{ env.WORKSPACE }} run cy:check-types
186
working-directory: js
193
if: needs.conditional.outputs.js-ci == 'true'
194
runs-on: ubuntu-latest
196
WORKSPACE: account-ui
198
- uses: actions/checkout@v4
200
- uses: ./.github/actions/pnpm-setup
202
working-directory: js
204
- name: Download Keycloak server
205
uses: actions/download-artifact@v3
210
uses: actions/setup-java@v4
212
distribution: temurin
215
- name: Start Keycloak server
217
tar xfvz keycloak-999.0.0-SNAPSHOT.tar.gz
218
keycloak-999.0.0-SNAPSHOT/bin/kc.sh start-dev --features=transient-users &> ~/server.log &
220
KEYCLOAK_ADMIN: admin
221
KEYCLOAK_ADMIN_PASSWORD: admin
223
- name: Install Playwright browsers
224
run: pnpm --filter ${{ env.WORKSPACE }} exec playwright install --with-deps
225
working-directory: js
227
- name: Run Playwright tests
228
run: pnpm --filter ${{ env.WORKSPACE }} run test
229
working-directory: js
231
KEYCLOAK_SERVER: http://localhost:8080
233
- uses: actions/upload-artifact@v3
236
name: account-ui-playwright-report
237
path: js/apps/${{ env.WORKSPACE }}/playwright-report
240
- name: Upload server logs
242
uses: actions/upload-artifact@v3
244
name: account-ui-server-log
253
if: needs.conditional.outputs.js-ci == 'true' && github.repository == 'keycloak/keycloak'
254
runs-on: ubuntu-latest
259
container: [1, 2, 3, 4, 5]
260
browser: [chrome, firefox]
262
# Only test with Firefox on scheduled runs
263
- browser: ${{ github.event_name != 'workflow_dispatch' && 'firefox' || '' }}
265
- uses: actions/checkout@v4
267
- name: Install Google Chrome
268
if: matrix.browser == 'chrome'
269
uses: browser-actions/setup-chrome@v1
271
chrome-version: stable
273
- name: Install Firefox
274
if: matrix.browser == 'firefox'
275
uses: browser-actions/setup-firefox@v1
277
firefox-version: latest
279
- uses: ./.github/actions/pnpm-setup
281
working-directory: js
283
- name: Compile Admin Client
284
run: pnpm --filter @keycloak/keycloak-admin-client run build
285
working-directory: js
287
- name: Download Keycloak server
288
uses: actions/download-artifact@v3
293
uses: actions/setup-java@v4
295
distribution: temurin
298
- name: Start Keycloak server
300
tar xfvz keycloak-999.0.0-SNAPSHOT.tar.gz
301
keycloak-999.0.0-SNAPSHOT/bin/kc.sh start-dev --features=admin-fine-grained-authz,transient-users &> ~/server.log &
303
KEYCLOAK_ADMIN: admin
304
KEYCLOAK_ADMIN_PASSWORD: admin
306
- name: Start LDAP server
307
run: pnpm --filter ${{ env.WORKSPACE }} run cy:ldap-server &
308
working-directory: js
311
uses: cypress-io/github-action@v6
314
browser: ${{ matrix.browser }}
315
wait-on: http://localhost:8080
316
working-directory: js/apps/admin-ui
318
CYPRESS_BASE_URL: http://localhost:8080/admin/
319
CYPRESS_KEYCLOAK_SERVER: http://localhost:8080
320
SPLIT: ${{ strategy.job-total }}
321
SPLIT_INDEX: ${{ strategy.job-index }}
323
- name: Upload server logs
325
uses: actions/upload-artifact@v3
327
name: admin-ui-server-log-${{ matrix.container }}-${{ matrix.browser }}
330
- name: Upload Cypress videos
331
uses: actions/upload-artifact@v3
332
if: always() && github.repository != 'keycloak/keycloak-private'
334
name: cypress-videos-${{ matrix.container }}-${{ matrix.browser }}
335
path: js/apps/admin-ui/cypress/videos
336
if-no-files-found: ignore
340
name: Status Check - Keycloak JavaScript CI
353
runs-on: ubuntu-latest
355
- uses: actions/checkout@v4
356
- uses: ./.github/actions/status-check
358
jobs: ${{ toJSON(needs) }}