Skip to content

Commit

Permalink
Added github test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yannis committed Aug 31, 2022
1 parent 4b30170 commit 3ee414f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rokku-STS tests

on: [ push ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'sbt'
- name: Run docker-compose
run: docker-compose up -d && ./scripts/waitForContainerSetup.sh
- name: Run tests
run: sbt clean coverage test it:test coverageReport
14 changes: 12 additions & 2 deletions waitForContainerSetup.sh → scripts/waitForContainerSetup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ set -e
# Max query attempts before consider setup failed
MAX_TRIES=90

function rokkuKeycloak() {
function keycloak() {
docker-compose logs keycloak | grep "Admin console listening"
}

function redis() {
docker-compose logs redis | grep "Ready to accept connections"
}

function vault() {
docker-compose logs vault | grep "upgrading keys finished"
}

function waitUntilServiceIsReady() {
attempt=1
while [ $attempt -le $MAX_TRIES ]; do
Expand All @@ -27,4 +35,6 @@ function waitUntilServiceIsReady() {
fi
}

waitUntilServiceIsReady rokkuKeycloak "Keycloack ready"
waitUntilServiceIsReady redis "Redis is ready"
waitUntilServiceIsReady vault "Vault is ready"
waitUntilServiceIsReady keycloak "Keycloack is ready"

0 comments on commit 3ee414f

Please sign in to comment.