2023-02-03 10:45:11 +00:00
|
|
|
name: Keycloak JavaScript CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- main
|
|
|
|
- dependabot/**
|
|
|
|
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
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 17
|
|
|
|
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
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
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
|
|
|
with:
|
2023-02-10 13:14:23 +00:00
|
|
|
working-directory: js
|
2023-02-03 10:45:11 +00:00
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
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
|
|
|
with:
|
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
2023-03-09 12:34:20 +00:00
|
|
|
|
2023-03-09 12:48:26 +00:00
|
|
|
keycloak-masthead:
|
|
|
|
name: Keycloak Masthead
|
|
|
|
needs: conditional
|
|
|
|
if: needs.conditional.outputs.js-ci == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
WORKSPACE: keycloak-masthead
|
|
|
|
steps:
|
2023-09-06 11:40:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-09 12:48:26 +00:00
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- uses: ./.github/actions/pnpm-setup
|
2023-03-09 12:48:26 +00:00
|
|
|
with:
|
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
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:
|
|
|
|
WORKSPACE: ui-shared
|
|
|
|
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
|
|
|
with:
|
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
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:
|
|
|
|
WORKSPACE: account-ui
|
|
|
|
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
|
|
|
with:
|
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
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:
|
|
|
|
WORKSPACE: admin-ui
|
|
|
|
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
|
|
|
with:
|
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run test
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-08-14 14:41:58 +00:00
|
|
|
- run: pnpm --filter ${{ env.WORKSPACE }} run cy:check-types
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
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:
|
|
|
|
WORKSPACE: account-ui
|
|
|
|
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
|
|
|
|
with:
|
|
|
|
working-directory: js
|
|
|
|
|
|
|
|
- name: Download Keycloak server
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: keycloak
|
|
|
|
|
|
|
|
- name: Setup Java
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 17
|
|
|
|
|
|
|
|
- name: Start Keycloak server
|
|
|
|
run: |
|
|
|
|
tar xfvz keycloak-999.0.0-SNAPSHOT.tar.gz
|
2023-11-07 08:17:11 +00:00
|
|
|
keycloak-999.0.0-SNAPSHOT/bin/kc.sh start-dev --features=declarative-user-profile,transient-users &> ~/server.log &
|
2023-08-14 14:41:58 +00:00
|
|
|
env:
|
|
|
|
KEYCLOAK_ADMIN: admin
|
|
|
|
KEYCLOAK_ADMIN_PASSWORD: admin
|
|
|
|
|
|
|
|
- name: Install Playwright browsers
|
|
|
|
run: pnpm --filter ${{ env.WORKSPACE }} exec playwright install --with-deps
|
|
|
|
working-directory: js
|
|
|
|
|
|
|
|
- name: Run Playwright tests
|
|
|
|
run: pnpm --filter ${{ env.WORKSPACE }} run test
|
|
|
|
working-directory: js
|
|
|
|
env:
|
|
|
|
KEYCLOAK_SERVER: http://localhost:8080
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: account-ui-playwright-report
|
|
|
|
path: js/apps/${{ env.WORKSPACE }}/playwright-report
|
|
|
|
retention-days: 30
|
|
|
|
|
|
|
|
- name: Upload server logs
|
|
|
|
if: always()
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: account-ui-server-log
|
|
|
|
path: ~/server.log
|
|
|
|
|
|
|
|
|
2023-03-20 12:38:10 +00:00
|
|
|
admin-ui-e2e:
|
|
|
|
name: Admin UI E2E
|
|
|
|
needs:
|
|
|
|
- conditional
|
|
|
|
- build-keycloak
|
2023-03-23 13:41:12 +00:00
|
|
|
if: needs.conditional.outputs.js-ci == 'true' && github.repository == 'keycloak/keycloak'
|
2023-03-20 12:38:10 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
WORKSPACE: 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' || '' }}
|
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
|
|
|
with:
|
|
|
|
working-directory: js
|
|
|
|
|
|
|
|
- name: Compile Admin Client
|
2023-08-14 14:41:58 +00:00
|
|
|
run: pnpm --filter @keycloak/keycloak-admin-client run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
|
|
|
- name: Download Keycloak server
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: keycloak
|
|
|
|
|
2023-07-05 13:53:39 +00:00
|
|
|
- name: Setup Java
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 17
|
|
|
|
|
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-11-07 08:17:11 +00:00
|
|
|
keycloak-999.0.0-SNAPSHOT/bin/kc.sh start-dev --features=admin-fine-grained-authz,declarative-user-profile,transient-users &> ~/server.log &
|
2023-03-20 12:38:10 +00:00
|
|
|
env:
|
|
|
|
KEYCLOAK_ADMIN: admin
|
|
|
|
KEYCLOAK_ADMIN_PASSWORD: admin
|
|
|
|
|
|
|
|
- name: Start LDAP server
|
2023-08-14 14:41:58 +00:00
|
|
|
run: pnpm --filter ${{ env.WORKSPACE }} run cy:ldap-server &
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
|
|
|
- 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
|
|
|
|
record: true
|
2023-03-20 15:36:25 +00:00
|
|
|
parallel: true
|
2023-06-20 12:21:49 +00:00
|
|
|
group: ${{ matrix.browser }}
|
|
|
|
browser: ${{ matrix.browser }}
|
2023-03-20 12:38:10 +00:00
|
|
|
wait-on: http://localhost:8080
|
|
|
|
working-directory: js/apps/admin-ui
|
|
|
|
env:
|
|
|
|
CYPRESS_BASE_URL: http://localhost:8080/admin/
|
|
|
|
CYPRESS_KEYCLOAK_SERVER: http://localhost:8080
|
|
|
|
CYPRESS_RECORD_KEY: b8f1d15e-eab8-4ee7-8e44-c6d7cd8fc0eb
|
2023-03-23 13:41:12 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-03-20 12:38:10 +00:00
|
|
|
|
|
|
|
- name: Upload server logs
|
2023-08-14 14:41:58 +00:00
|
|
|
if: always()
|
2023-03-20 12:38:10 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
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
|
|
|
|
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
|
2023-02-10 13:14:23 +00:00
|
|
|
- admin-client
|
2023-03-09 12:48:26 +00:00
|
|
|
- keycloak-js
|
|
|
|
- keycloak-masthead
|
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) }}
|