Skip to content

Commit 8292e7e

Browse files
chore(spring-keycloak-example): add workflow and validations
1 parent 2b447d0 commit 8292e7e

2 files changed

Lines changed: 73 additions & 3 deletions

File tree

.github/labeler.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
- changed-files:
77
- any-glob-to-any-file: 'spring-prometheus-grafana-example/**/*'
88

9+
"project: spring-keycloak-example":
10+
- changed-files:
11+
- any-glob-to-any-file: 'spring-keycloak-example/**/*'
12+
913
"type: dependency-upgrade":
1014
- changed-files:
11-
- any-glob-to-any-file:
12-
- spring-kafka-example/pom.xml
13-
- spring-prometheus-grafana-example/pom.xml
15+
- any-glob-to-any-file: "**/pom.xml"
1416

1517
"ci: github-actions":
1618
- changed-files:
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: spring-keycloak-example CI Build
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
paths:
7+
- "spring-keycloak-example/**"
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
12+
13+
jobs:
14+
15+
integration-tests:
16+
name: Run Unit & Integration Tests
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: spring-keycloak-example
21+
strategy:
22+
matrix:
23+
distribution: [ 'temurin' ]
24+
java: [ '21' ]
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Set up JDK ${{ matrix.java }}
31+
uses: actions/setup-java@v4.7.1
32+
with:
33+
java-version: ${{ matrix.java }}
34+
distribution: ${{ matrix.distribution }}
35+
cache: 'maven'
36+
- name: Build and analyze
37+
run: ./mvnw clean verify
38+
39+
health-check:
40+
name: Health Check on Services
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout repository and submodules
44+
uses: actions/checkout@v4
45+
with:
46+
submodules: true
47+
48+
- name: Extract service names from docker compose
49+
id: services
50+
run: |
51+
echo "services<<EOF" >> $GITHUB_OUTPUT
52+
docker compose -f ./spring-keycloak-example/compose.yaml config --services >> $GITHUB_OUTPUT
53+
echo "EOF" >> $GITHUB_OUTPUT
54+
55+
- name: Start containers with Compose Action
56+
uses: hoverkraft-tech/compose-action@v2.3.0
57+
with:
58+
compose-file: './spring-keycloak-example/compose.yaml'
59+
services: ${{ steps.services.outputs.services }}
60+
up-flags: '--build'
61+
down-flags: '--volumes'
62+
63+
- name: Wait for containers to initialize
64+
run: sleep 10
65+
66+
- name: Check container health
67+
run: |
68+
./.github/scripts/check-container-health.sh "${{ steps.services.outputs.services }}"

0 commit comments

Comments
 (0)