2023-02-03 10:45:11 +00:00
|
|
|
name: Keycloak JavaScript CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- main
|
|
|
|
- dependabot/**
|
2024-01-23 08:43:31 +00:00
|
|
|
- quarkus-next
|
2023-02-03 10:45:11 +00:00
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2023-12-05 07:30:11 +00:00
|
|
|
env:
|
|
|
|
MAVEN_ARGS: "-B -nsu -Daether.connector.http.connectionMaxTtl=25"
|
|
|
|
|
2023-02-03 10:45:11 +00:00
|
|
|
concurrency:
|
|
|
|
# Only cancel jobs for PR updates
|
2023-07-27 04:26:03 +00:00
|
|
|
group: js-ci-${{ github.ref }}
|
2023-02-03 10:45:11 +00:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
conditional:
|
|
|
|
name: Check conditional workflows and jobs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
js-ci: ${{ steps.conditional.outputs.js }}
|
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-03 10:45:11 +00:00
|
|
|
|
|
|
|
- id: conditional
|
|
|
|
uses: ./.github/actions/conditional
|
2023-07-25 13:43:53 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-03 10:45:11 +00:00
|
|
|
|
2023-03-20 12:38:10 +00:00
|
|
|
build-keycloak:
|
|
|
|
name: Build Keycloak
|
|
|
|
needs: conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Setup Java
|
2023-11-30 00:29:04 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-03-20 12:38:10 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
2024-06-03 12:17:28 +00:00
|
|
|
java-version: 21
|
2023-03-20 12:38:10 +00:00
|
|
|
check-latest: true
|
|
|
|
cache: maven
|
|
|
|
|
|
|
|
- name: Build Keycloak
|
|
|
|
run: |
|
2023-12-05 07:30:11 +00:00
|
|
|
./mvnw clean install --errors -DskipTests -DskipTestsuite -DskipExamples -Pdistribution
|
2023-03-20 12:38:10 +00:00
|
|
|
mv ./quarkus/dist/target/keycloak-999.0.0-SNAPSHOT.tar.gz ./keycloak-999.0.0-SNAPSHOT.tar.gz
|
|
|
|
|
|
|
|
- name: Upload Keycloak dist
|
2024-04-15 15:14:00 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-03-20 12:38:10 +00:00
|
|
|
with:
|
|
|
|
name: keycloak
|
|
|
|
path: keycloak-999.0.0-SNAPSHOT.tar.gz
|
|
|
|
|
2023-02-10 13:14:23 +00:00
|
|
|
admin-client:
|
|
|
|
name: Admin Client
|
2023-02-03 10:45:11 +00:00
|
|
|
needs: conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
2023-02-10 13:14:23 +00:00
|
|
|
env:
|
|
|
|
WORKSPACE: "@keycloak/keycloak-admin-client"
|
2023-02-03 10:45:11 +00:00
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-03 10:45:11 +00:00
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- uses: ./.github/actions/pnpm-setup
|
2023-02-03 10:45:11 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
|
2023-02-03 10:45:11 +00:00
|
|
|
|
2023-03-09 12:34:20 +00:00
|
|
|
keycloak-js:
|
|
|
|
name: Keycloak JS
|
|
|
|
needs: conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
WORKSPACE: keycloak-js
|
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-09 12:34:20 +00:00
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- uses: ./.github/actions/pnpm-setup
|
2023-03-09 12:34:20 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
|
2023-03-09 12:48:26 +00:00
|
|
|
|
2023-03-09 13:52:37 +00:00
|
|
|
ui-shared:
|
|
|
|
name: UI Shared
|
|
|
|
needs: conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2024-06-03 11:42:44 +00:00
|
|
|
WORKSPACE: "@keycloak/keycloak-ui-shared"
|
2023-03-09 13:52:37 +00:00
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-09 13:52:37 +00:00
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- uses: ./.github/actions/pnpm-setup
|
2023-03-09 13:52:37 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
|
2023-03-09 13:52:37 +00:00
|
|
|
|
2023-03-09 12:20:34 +00:00
|
|
|
account-ui:
|
|
|
|
name: Account UI
|
|
|
|
needs: conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2024-06-03 11:42:44 +00:00
|
|
|
WORKSPACE: "@keycloak/keycloak-account-ui"
|
2023-03-09 12:20:34 +00:00
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-09 12:20:34 +00:00
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- uses: ./.github/actions/pnpm-setup
|
2023-03-09 12:20:34 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
|
2023-03-09 12:20:34 +00:00
|
|
|
|
2023-03-09 12:07:11 +00:00
|
|
|
admin-ui:
|
|
|
|
name: Admin UI
|
|
|
|
needs: conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2024-07-05 16:48:10 +00:00
|
|
|
WORKSPACE: keycloak-admin-ui
|
2023-03-09 12:07:11 +00:00
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-09 12:07:11 +00:00
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- uses: ./.github/actions/pnpm-setup
|
2023-03-09 12:07:11 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:check-types
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
account-ui-e2e:
|
|
|
|
name: Account UI E2E
|
|
|
|
needs:
|
|
|
|
- conditional
|
|
|
|
- build-keycloak
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2024-06-03 11:42:44 +00:00
|
|
|
WORKSPACE: "@keycloak/keycloak-account-ui"
|
2023-08-14 14:41:58 +00:00
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-14 14:41:58 +00:00
|
|
|
|
|
|
|
- uses: ./.github/actions/pnpm-setup
|
|
|
|
|
|
|
|
- name: Download Keycloak server
|
2024-04-15 15:14:00 +00:00
|
|
|
uses: actions/download-artifact@v4
|
2023-08-14 14:41:58 +00:00
|
|
|
with:
|
|
|
|
name: keycloak
|
|
|
|
|
|
|
|
- name: Setup Java
|
2023-11-30 00:29:04 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-08-14 14:41:58 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
2024-06-03 12:17:28 +00:00
|
|
|
java-version: 21
|
2023-08-14 14:41:58 +00:00
|
|
|
|
|
|
|
- name: Start Keycloak server
|
|
|
|
run: |
|
|
|
|
tar xfvz keycloak-999.0.0-SNAPSHOT.tar.gz
|
2024-05-31 13:11:32 +00:00
|
|
|
keycloak-999.0.0-SNAPSHOT/bin/kc.sh start-dev --features=transient-users,oid4vc-vci &> ~/server.log &
|
2023-08-14 14:41:58 +00:00
|
|
|
env:
|
2024-07-11 16:07:57 +00:00
|
|
|
KC_BOOTSTRAP_ADMIN_USERNAME: admin
|
|
|
|
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
|
2023-08-14 14:41:58 +00:00
|
|
|
|
|
|
|
- name: Install Playwright browsers
|
2024-06-03 11:42:44 +00:00
|
|
|
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} exec playwright install --with-deps
|
2023-08-14 14:41:58 +00:00
|
|
|
|
|
|
|
- name: Run Playwright tests
|
2024-06-03 11:42:44 +00:00
|
|
|
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test
|
2023-08-14 14:41:58 +00:00
|
|
|
|
2024-06-03 11:42:44 +00:00
|
|
|
- name: Upload Playwright report
|
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-14 14:41:58 +00:00
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: account-ui-playwright-report
|
2024-06-03 11:42:44 +00:00
|
|
|
path: js/apps/account-ui/playwright-report
|
2023-08-14 14:41:58 +00:00
|
|
|
retention-days: 30
|
|
|
|
|
|
|
|
- name: Upload server logs
|
|
|
|
if: always()
|
2024-04-15 15:14:00 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-14 14:41:58 +00:00
|
|
|
with:
|
|
|
|
name: account-ui-server-log
|
|
|
|
path: ~/server.log
|
|
|
|
|
|
|
|
|
2024-05-08 13:33:21 +00:00
|
|
|
generate-test-seed:
|
|
|
|
name: Generate Test Seed
|
|
|
|
needs:
|
|
|
|
- conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
seed: ${{ steps.generate-random-number.outputs.value }}
|
|
|
|
steps:
|
|
|
|
- name: Generate random number
|
|
|
|
id: generate-random-number
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "value=$(shuf -i 1-100 -n 1)" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-03-20 12:38:10 +00:00
|
|
|
admin-ui-e2e:
|
|
|
|
name: Admin UI E2E
|
|
|
|
needs:
|
|
|
|
- conditional
|
|
|
|
- build-keycloak
|
2024-05-08 13:33:21 +00:00
|
|
|
- generate-test-seed
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
2023-03-20 12:38:10 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2024-07-05 16:48:10 +00:00
|
|
|
WORKSPACE: keycloak-admin-ui
|
2023-03-20 15:36:25 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
container: [1, 2, 3, 4, 5]
|
2023-06-20 12:21:49 +00:00
|
|
|
browser: [chrome, firefox]
|
|
|
|
exclude:
|
|
|
|
# Only test with Firefox on scheduled runs
|
2023-07-21 09:51:10 +00:00
|
|
|
- browser: ${{ github.event_name != 'workflow_dispatch' && 'firefox' || '' }}
|
2024-06-03 08:59:52 +00:00
|
|
|
fail-fast: false
|
2023-03-20 12:38:10 +00:00
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Install Google Chrome
|
2023-06-20 12:21:49 +00:00
|
|
|
if: matrix.browser == 'chrome'
|
2023-03-20 12:38:10 +00:00
|
|
|
uses: browser-actions/setup-chrome@v1
|
2023-03-20 15:36:25 +00:00
|
|
|
with:
|
|
|
|
chrome-version: stable
|
2023-03-20 12:38:10 +00:00
|
|
|
|
2023-06-20 12:21:49 +00:00
|
|
|
- name: Install Firefox
|
|
|
|
if: matrix.browser == 'firefox'
|
|
|
|
uses: browser-actions/setup-firefox@v1
|
|
|
|
with:
|
|
|
|
firefox-version: latest
|
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- uses: ./.github/actions/pnpm-setup
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Compile Admin Client
|
2024-06-03 11:42:44 +00:00
|
|
|
run: pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-client build
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Download Keycloak server
|
2024-04-15 15:14:00 +00:00
|
|
|
uses: actions/download-artifact@v4
|
2023-03-20 12:38:10 +00:00
|
|
|
with:
|
|
|
|
name: keycloak
|
|
|
|
|
2023-07-05 13:53:39 +00:00
|
|
|
- name: Setup Java
|
2023-11-30 00:29:04 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-07-05 13:53:39 +00:00
|
|
|
with:
|
|
|
|
distribution: temurin
|
2024-06-03 12:17:28 +00:00
|
|
|
java-version: 21
|
2023-07-05 13:53:39 +00:00
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- name: Start Keycloak server
|
2023-03-20 12:38:10 +00:00
|
|
|
run: |
|
|
|
|
tar xfvz keycloak-999.0.0-SNAPSHOT.tar.gz
|
2023-12-19 08:25:54 +00:00
|
|
|
keycloak-999.0.0-SNAPSHOT/bin/kc.sh start-dev --features=admin-fine-grained-authz,transient-users &> ~/server.log &
|
2023-03-20 12:38:10 +00:00
|
|
|
env:
|
2024-07-11 16:07:57 +00:00
|
|
|
KC_BOOTSTRAP_ADMIN_USERNAME: admin
|
|
|
|
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Start LDAP server
|
2024-06-03 11:42:44 +00:00
|
|
|
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:ldap-server &
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Run Cypress
|
2023-08-22 10:58:45 +00:00
|
|
|
uses: cypress-io/github-action@v6
|
2023-03-20 12:38:10 +00:00
|
|
|
with:
|
|
|
|
install: false
|
2023-06-20 12:21:49 +00:00
|
|
|
browser: ${{ matrix.browser }}
|
2023-03-20 12:38:10 +00:00
|
|
|
wait-on: http://localhost:8080
|
|
|
|
working-directory: js/apps/admin-ui
|
|
|
|
env:
|
2024-02-20 10:10:54 +00:00
|
|
|
SPLIT: ${{ strategy.job-total }}
|
|
|
|
SPLIT_INDEX: ${{ strategy.job-index }}
|
2024-05-08 13:33:21 +00:00
|
|
|
SPLIT_RANDOM_SEED: ${{ needs.generate-test-seed.outputs.seed }}
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Upload server logs
|
2023-08-14 14:41:58 +00:00
|
|
|
if: always()
|
2024-04-15 15:14:00 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-03-20 12:38:10 +00:00
|
|
|
with:
|
2023-08-14 14:41:58 +00:00
|
|
|
name: admin-ui-server-log-${{ matrix.container }}-${{ matrix.browser }}
|
2023-03-20 12:38:10 +00:00
|
|
|
path: ~/server.log
|
2023-03-09 12:07:11 +00:00
|
|
|
|
2024-02-27 13:03:34 +00:00
|
|
|
- name: Upload Cypress videos
|
2024-04-15 15:14:00 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2024-03-01 14:09:03 +00:00
|
|
|
if: always() && github.repository != 'keycloak/keycloak-private'
|
2024-02-27 13:03:34 +00:00
|
|
|
with:
|
|
|
|
name: cypress-videos-${{ matrix.container }}-${{ matrix.browser }}
|
|
|
|
path: js/apps/admin-ui/cypress/videos
|
|
|
|
if-no-files-found: ignore
|
|
|
|
retention-days: 10
|
|
|
|
|
2023-07-28 05:04:16 +00:00
|
|
|
check:
|
|
|
|
name: Status Check - Keycloak JavaScript CI
|
|
|
|
if: always()
|
2023-02-03 10:45:11 +00:00
|
|
|
needs:
|
2023-09-05 06:34:41 +00:00
|
|
|
- conditional
|
2024-01-09 07:39:43 +00:00
|
|
|
- build-keycloak
|
2023-02-10 13:14:23 +00:00
|
|
|
- admin-client
|
2023-03-09 12:48:26 +00:00
|
|
|
- keycloak-js
|
2023-03-09 13:52:37 +00:00
|
|
|
- ui-shared
|
2023-03-09 12:20:34 +00:00
|
|
|
- account-ui
|
2023-08-14 14:41:58 +00:00
|
|
|
- account-ui-e2e
|
2023-03-09 12:07:11 +00:00
|
|
|
- admin-ui
|
2023-03-20 12:38:10 +00:00
|
|
|
- admin-ui-e2e
|
2023-02-03 10:45:11 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-07-28 05:04:16 +00:00
|
|
|
- uses: ./.github/actions/status-check
|
2023-02-03 10:45:11 +00:00
|
|
|
with:
|
2023-07-28 05:04:16 +00:00
|
|
|
jobs: ${{ toJSON(needs) }}
|