-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (96 loc) · 3.35 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
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/client_certs/ca.crt
CERT_PATH: /test/client_certs/client.crt
CERT_KEY: /test/client_certs/client.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/crypt4gh.sec.pem
CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH: test/crypt4gh/crypt4gh.pass
BROKER_USERNAME: admin
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 compose -f docker-compose-${{ matrix.storagetype }}-outbox.yml up -d
- name: Sleep and Status check
run: |
sleep 10
docker ps
- name: Make encryption files
run: |
/bin/sh ./test/make_crypt4gh_files.sh
- name: List files in the directory
run: ls -l ./test/client_certs
- name: Transform Client Private Key to DER
run: |
chmod 644 ./test/client_certs/client.key
openssl pkcs8 -topk8 -inform PEM -outform DER -in /test/client_certs/client.key -out /test/client_certs/client.der -nocrypt
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: zulu
java-version: ${{ matrix.java-version }}
- 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 ps