-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (88 loc) · 2.98 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
name: Java CI
on:
push:
jobs:
doa:
name: DOA test with ${{ matrix.storagetype }} and outbox
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
storagetype: [s3, posix]
java-version: [21]
env:
SSL_ENABLED: false
BROKER_HOST: localhost
BROKER_VALIDATE: false
DB_INSTANCE: localhost
ROOT_CERT_PATH: test/rootCA.pem
CERT_PATH: test/localhost-client.pem
CERT_KEY: test/localhost-client-key.der
POSTGRES_PASSWORD: rootpasswd
OPENID_CONFIGURATION_URL: http://localhost:8000/openid-configuration
USERINFO_ENDPOINT_URL: http://localhost:8000/userinfo
CRYPT4GH_PRIVATE_KEY_PATH: test/crypt4gh.sec.pem
CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH: test/crypt4gh.pass
steps:
- uses: actions/checkout@v4
- name: Set S3 env variables
if: matrix.storagetype == 's3'
run: |
echo "OUTBOX_TYPE=S3" >> $GITHUB_ENV
echo "S3_OUT_ENDPOINT=localhost" >> $GITHUB_ENV
echo "S3_OUT_PORT=9000" >> $GITHUB_ENV
echo "S3_OUT_SECURE=false" >> $GITHUB_ENV
- name: Set posix env variables
if: matrix.storagetype == 'posix'
run: |
echo "OUTBOX_TYPE=POSIX" >> $GITHUB_ENV
echo "OUTBOX_LOCATION=$PWD/%s/files/" >> $GITHUB_ENV
- name: Docker Stack Deploy for ${{ matrix.storagetype }} storage
run: |
docker swarm init
docker stack deploy DOA --compose-file docker-compose-${{ matrix.storagetype }}-outbox.yml
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: zulu
java-version: ${{ matrix.java-version }}
- name: Sleep and Status check
run: |
sleep 30
docker service list
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: create maven settings.xml
uses: s4u/[email protected]
with:
servers: |
[{
"id":"github-fega-norway",
"username": "${{github.actor}}",
"password": "${{ secrets.GITHUB_TOKEN }}"
}]
- name: Spring Boot Run
run: nohup mvn -gs ~/.m2/settings.xml spring-boot:run --no-transfer-progress > nohup.out &
- name: Wait for app to start
run: |
RETRY_TIMES=0
until lsof -i -P -n | grep ":8080";
do
RETRY_TIMES=$((RETRY_TIMES+1));
if [ $RETRY_TIMES -eq 30 ]; then exit 1; fi
sleep 10;
done
- name: Test
run: mvn -gs ~/.m2/settings.xml test --no-transfer-progress
- name: Spring Boot Run Logs
if: failure()
run: cat nohup.out
- name: Docker Service Logs
if: failure()
run: |
docker service logs DOA_db
docker service logs DOA_mockauth