Merge pull request #10 from jmontleon/multi-stage-dockerfile.init #41
Workflow file for this run
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: CI | |
on: [push, pull_request] | |
jobs: | |
e2e: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
browser: [chrome, firefox] | |
services: | |
keycloak-db: | |
image: postgres:13.1 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: user | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: keycloak_db | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Maven | |
run: mvn package | |
- name: Create image | |
uses: elgohr/[email protected] | |
with: | |
name: konveyor/tackle-keycloak-theme | |
dockerfile: Dockerfile | |
snapshot: false | |
tags: "test" | |
no_push: true | |
- name: Start keycloak | |
run: | | |
docker run -d --name keycloak --network ${{ job.services.keycloak-db.network }} --network-alias keycloak -p 8080:8080 \ | |
-e KEYCLOAK_USER=admin \ | |
-e KEYCLOAK_PASSWORD=admin \ | |
-e DB_VENDOR=postgres \ | |
-e DB_USER=user \ | |
-e DB_PASSWORD=password \ | |
-e DB_DATABASE=keycloak_db \ | |
-e DB_ADDR=keycloak-db \ | |
konveyor/tackle-keycloak-theme:test | |
sleep 5s && docker logs keycloak | |
- name: Keycloak Admin CLI | |
uses: carlosthe19916/[email protected] | |
with: | |
server: http://keycloak:8080/auth | |
username: admin | |
password: admin | |
kcadm: update realms/master -s loginTheme=konveyor | |
- name: Cypress run | |
uses: cypress-io/github-action@v2 | |
with: | |
record: false | |
wait-on: "http://localhost:8080/auth" | |
wait-on-timeout: 120 | |
config: pageLoadTimeout=100000,baseUrl=http://localhost:8080 | |
browser: ${{ matrix.browser }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@v1 | |
if: failure() | |
with: | |
name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} | |
path: cypress/screenshots | |
- uses: actions/upload-artifact@v1 | |
if: always() | |
with: | |
name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} | |
path: cypress/videos |