Keycloak: Revise OPA integration #610
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Acme e2e Test CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
e2e-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Configure JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Configure Node.js '18.x' | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: Prepare artifacts (e.g. extensions) for docker-compose stack | |
run: mvn --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -DskipTests verify --file pom.xml --settings maven-settings.xml -pl keycloak/extensions,keycloak/docker | |
- name: Build the docker-compose stack | |
run: | | |
USER="$(id -u)" | |
GROUP="" | |
export USER | |
export GROUP | |
echo "Running as ${USER}:${GROUP}" | |
java bin/envcheck.java | |
touch deployments/local/dev/keycloakx/acme.test+1.pem | |
java start.java --http --extensions=jar --keycloak=keycloakx --ci=github --detach | |
- name: Show current containers | |
run: | | |
docker ps -a | |
# - name: Check keycloak is reachable | |
# run: docker run --network container:dev_acme-keycloak_1 --rm appropriate/curl -s --retry 15 --max-time 180 --retry-connrefused http://localhost:8080/auth/realms/acme-internal | |
- name: Sleep | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '70s' | |
- name: Check docker-compose stack | |
if: ${{ always() }} | |
run: | | |
docker ps -a | |
docker inspect dev-acme-keycloak-1 | |
docker logs --details dev-acme-keycloak-1 | |
- name: Run cypress tests | |
working-directory: ./keycloak/e2e-tests | |
# https://docs.cypress.io/guides/references/configuration#Timeouts | |
run: | | |
yarn install | |
docker run --network container:dev-acme-keycloak-1 --rm -v "${PWD}":/e2e -w /e2e --entrypoint=cypress cypress/included:10.8.0 run --config pageLoadTimeout=70000,defaultCommandTimeout=10000,watchForFileChanges=false --env keycloak_host=http://localhost:8080 | |
- name: Archive testrun video | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: testrun-video | |
path: ./keycloak/e2e-tests/cypress/videos/ | |
retention-days: 1 | |
- name: Shutdown the docker-compose stack | |
if: ${{ always() }} | |
run: java stop.java --skip=grafana |