2023-02-03 10:45:11 +00:00
|
|
|
name: Keycloak JavaScript CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- main
|
|
|
|
- dependabot/**
|
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
# Only cancel jobs for PR updates
|
|
|
|
group: js-ci-${{ github.head_ref || github.run_id }}
|
|
|
|
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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- id: conditional
|
|
|
|
uses: ./.github/actions/conditional
|
|
|
|
|
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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup Java
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 17
|
|
|
|
check-latest: true
|
|
|
|
cache: maven
|
|
|
|
|
|
|
|
- name: Build Keycloak
|
|
|
|
run: |
|
2022-12-09 15:44:22 +00:00
|
|
|
./mvnw clean install --batch-mode --errors -DskipTests -DskipTestsuite -DskipExamples -DskipAccount2 -DskipCommon -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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
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-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-05-05 16:03:24 +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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
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-05-05 16:03:24 +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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
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-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-05-05 16:03:24 +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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
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-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-05-05 16:03:24 +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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
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-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-05-05 16:03:24 +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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
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-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run lint
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run test
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run build
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
2023-05-05 16:03:24 +00:00
|
|
|
- run: pnpm --filter=${{ env.WORKSPACE }} run cy:check-types
|
2023-03-20 12:38:10 +00:00
|
|
|
working-directory: js
|
|
|
|
|
|
|
|
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:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- 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-05-05 16:03:24 +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-03-20 12:38:10 +00:00
|
|
|
- name: Start Keycloak Server
|
|
|
|
run: |
|
|
|
|
tar xfvz keycloak-999.0.0-SNAPSHOT.tar.gz
|
|
|
|
keycloak-999.0.0-SNAPSHOT/bin/kc.sh start-dev --features=admin-fine-grained-authz,declarative-user-profile &> ~/server.log &
|
|
|
|
env:
|
|
|
|
KEYCLOAK_ADMIN: admin
|
|
|
|
KEYCLOAK_ADMIN_PASSWORD: admin
|
|
|
|
|
|
|
|
- name: Start LDAP server
|
2023-05-05 16:03:24 +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
|
|
|
|
uses: cypress-io/github-action@v5
|
|
|
|
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
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-06-20 12:21:49 +00:00
|
|
|
name: 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-02-03 10:45:11 +00:00
|
|
|
check-set-status:
|
|
|
|
name: Set check conclusion
|
|
|
|
needs:
|
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-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
|
|
|
|
outputs:
|
|
|
|
conclusion: ${{ steps.check.outputs.conclusion }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- id: check
|
|
|
|
uses: ./.github/actions/checks-success
|
|
|
|
|
|
|
|
check:
|
|
|
|
name: Status Check - Keycloak JavaScript CI
|
2023-07-21 09:51:10 +00:00
|
|
|
if: always()
|
2023-02-03 10:45:11 +00:00
|
|
|
needs:
|
|
|
|
- conditional
|
|
|
|
- check-set-status
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Check status
|
|
|
|
uses: ./.github/actions/checks-job-pass
|
|
|
|
with:
|
2023-02-03 11:47:04 +00:00
|
|
|
required: ${{ needs.conditional.outputs.js-ci }}
|
2023-02-03 10:45:11 +00:00
|
|
|
conclusion: ${{ needs.check-set-status.outputs.conclusion }}
|