Run the Cypress tests on master of Keycloak Server (#1207)
This commit is contained in:
parent
bd423c4bbe
commit
668e20795b
1 changed files with 52 additions and 11 deletions
63
.github/workflows/cypress.yml
vendored
63
.github/workflows/cypress.yml
vendored
|
@ -7,21 +7,59 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
cypress-run:
|
cypress-run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
ADMIN_UI_PATH: admin-ui
|
||||||
|
KEYCLOAK_SERVER_PATH: keycloak-server
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Check out Admin UI
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: ${{ env.ADMIN_UI_PATH }}
|
||||||
|
|
||||||
- name: Build Keycloak server
|
- name: Check out Keycloak Server
|
||||||
run: docker build --tag keycloak .
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: keycloak/keycloak
|
||||||
|
path: ${{ env.KEYCLOAK_SERVER_PATH }}
|
||||||
|
|
||||||
- name: Start Keycloak server
|
- name: Set up Java
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 11
|
||||||
|
check-latest: true
|
||||||
|
cache: maven
|
||||||
|
|
||||||
|
# See https://issues.redhat.com/browse/KEYCLOAK-17812
|
||||||
|
- name: Update Maven settings
|
||||||
|
working-directory: ${{ env.KEYCLOAK_SERVER_PATH }}
|
||||||
|
run: cp .github/settings.xml ~/.m2
|
||||||
|
|
||||||
|
- name: Build Admin UI
|
||||||
|
working-directory: ${{ env.ADMIN_UI_PATH }}
|
||||||
|
run: mvn clean install --batch-mode --file keycloak-theme/pom.xml
|
||||||
|
|
||||||
|
- name: Build Keycloak Server
|
||||||
|
working-directory: ${{ env.KEYCLOAK_SERVER_PATH }}
|
||||||
|
run: mvn clean install --no-snapshot-updates --batch-mode --errors -DskipTests -Pdistribution
|
||||||
|
|
||||||
|
- name: Configure distribution path
|
||||||
|
working-directory: ${{ env.KEYCLOAK_SERVER_PATH }}
|
||||||
run: |
|
run: |
|
||||||
docker run --detach --publish 8080:8080 --env KEYCLOAK_USER=admin --env KEYCLOAK_PASSWORD=admin --name keycloak keycloak
|
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||||
sleep 10
|
echo "KEYCLOAK_SERVER_BIN=keycloak-server/distribution/server-dist/target/keycloak-$VERSION/bin" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Configure Keycloak server
|
- name: Start Keycloak Server
|
||||||
|
working-directory: ${{ env.KEYCLOAK_SERVER_BIN }}
|
||||||
run: |
|
run: |
|
||||||
docker exec keycloak /opt/jboss/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin
|
./add-user-keycloak.sh --user admin --password admin
|
||||||
docker exec keycloak /opt/jboss/keycloak/bin/kcadm.sh update realms/master -s "adminTheme=keycloak.v2"
|
./standalone.sh -Dkeycloak.profile.feature.admin2=enabled &
|
||||||
|
|
||||||
|
- name: Configure Keycloak Server
|
||||||
|
working-directory: ${{ env.KEYCLOAK_SERVER_BIN }}
|
||||||
|
run: |
|
||||||
|
./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin
|
||||||
|
./kcadm.sh update realms/master -s "adminTheme=keycloak.v2"
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
|
@ -29,11 +67,14 @@ jobs:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
check-latest: true
|
check-latest: true
|
||||||
cache: npm
|
cache: npm
|
||||||
|
cache-dependency-path: ${{ env.ADMIN_UI_PATH }}/package-lock.json
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
working-directory: ${{ env.ADMIN_UI_PATH }}
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run Cypress
|
- name: Run Cypress
|
||||||
|
working-directory: ${{ env.ADMIN_UI_PATH }}
|
||||||
run: CYPRESS_BASE_URL=http://localhost:8080/auth/admin/ CYPRESS_KEYCLOAK_SERVER=http://localhost:8080 npm run start:cypress-tests
|
run: CYPRESS_BASE_URL=http://localhost:8080/auth/admin/ CYPRESS_KEYCLOAK_SERVER=http://localhost:8080 npm run start:cypress-tests
|
||||||
|
|
||||||
- name: Add Cypress videos artifacts
|
- name: Add Cypress videos artifacts
|
||||||
|
@ -41,11 +82,11 @@ jobs:
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: cypress-videos
|
name: cypress-videos
|
||||||
path: assets/videos
|
path: ${{ env.ADMIN_UI_PATH }}/assets/videos
|
||||||
|
|
||||||
- name: Add Cypress screenshots artifacts
|
- name: Add Cypress screenshots artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: cypress-screenshots
|
name: cypress-screenshots
|
||||||
path: assets/screenshots
|
path: ${{ env.ADMIN_UI_PATH }}/assets/screenshots
|
||||||
|
|
Loading…
Reference in a new issue