-
Notifications
You must be signed in to change notification settings - Fork 15
122 lines (91 loc) · 2.83 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Test SHOGun
on:
push:
branches:
- main
pull_request:
jobs:
license-headers:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Check License Header
uses: apache/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commitlint:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
mvn-test:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set up Java 17
uses: actions/[email protected]
with:
java-version: 17
java-package: jdk
architecture: x64
- name: Handle caching of maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Test SHOGun with Maven
env:
KEYCLOAK_HOST: localhost
run: mvn -B test
startup:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Java 17
uses: actions/[email protected]
with:
java-version: 17
java-package: jdk
architecture: x64
- name: Cache the Maven packages to speed up build
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Run mvn install
run: mvn install --log-file mvn.out.txt
- name: Clone shogun-docker
run: git clone https://github.com/terrestris/shogun-docker
working-directory: ../
- name: Checkout specific commit to ensure reproducibility
run: git checkout 4fdcbc51fa2d20bcfb0bcafafdfdece83c863819
working-directory: ../shogun-docker
- name: Set environment variables
run: ./setEnvironment.sh
working-directory: ../shogun-docker
- name: Show environment variables
run: cat .env
working-directory: ../shogun-docker
- name: Start containers
run: docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d
working-directory: ../shogun-docker
- name: Inspect network
run: docker network inspect shogun-docker_default
working-directory: ../shogun-docker
- name: Check if application has started
run: ./scripts/wait.sh
- name: Docker logs
if: always()
run: docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs
working-directory: ../shogun-docker
- name: Maven output
if: always()
run: cat mvn.out.txt