2021-07-30 18:12:32 +00:00
|
|
|
name: Cypress
|
2021-01-12 17:04:52 +00:00
|
|
|
on:
|
|
|
|
push:
|
2021-07-30 18:12:32 +00:00
|
|
|
branches: [master]
|
2021-01-12 17:04:52 +00:00
|
|
|
pull_request:
|
2021-07-30 18:12:32 +00:00
|
|
|
branches: [master]
|
2021-01-12 17:04:52 +00:00
|
|
|
jobs:
|
|
|
|
cypress-run:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-07-30 18:12:32 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Build Keycloak server
|
|
|
|
run: docker build --tag keycloak .
|
|
|
|
|
|
|
|
- name: Start Keycloak server
|
|
|
|
run: |
|
|
|
|
docker run --detach --publish 8080:8080 --env KEYCLOAK_USER=admin --env KEYCLOAK_PASSWORD=admin --name keycloak keycloak
|
|
|
|
sleep 10
|
|
|
|
|
|
|
|
- name: Configure Keycloak server
|
|
|
|
run: |
|
|
|
|
docker exec keycloak /opt/jboss/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin
|
|
|
|
docker exec keycloak /opt/jboss/keycloak/bin/kcadm.sh update realms/master -s "adminTheme=keycloak.v2"
|
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
check-latest: true
|
2021-08-25 14:00:44 +00:00
|
|
|
cache: npm
|
2021-07-30 18:12:32 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Run Cypress
|
|
|
|
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
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: cypress-videos
|
|
|
|
path: assets/videos
|
|
|
|
|
|
|
|
- name: Add Cypress screenshots artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: cypress-screenshots
|
|
|
|
path: assets/screenshots
|