-
Notifications
You must be signed in to change notification settings - Fork 12
195 lines (186 loc) · 7.15 KB
/
test-frank-runner.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: TestFrankRunner.
on:
push:
pull_request:
workflow_dispatch:
inputs:
forceLatestFF:
description: Force testing against the latest F!F version from Nexus
type: boolean
required: true
default: false
jobs:
testing-linux:
strategy:
matrix:
example: [Frank2Example1, Frank2Example2, Frank2Example3, Frank2Example4]
name: Test linux ${{ matrix.example }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache Frank!Runner dependencies - build
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-frank-runner-build
restore-keys: |
${{ runner.os }}-frank-runner-build
- name: Cache Frank!Runner dependencies - download
uses: actions/cache@v3
with:
path: download
key: ${{ runner.os }}-frank-runner-download
restore-keys: |
${{ runner.os }}-frank-runner-download
- name: Cache Maven downloads
uses: actions/cache@v3
with:
path: ~/.m2/repository/
key: ${{ runner.os }}-maven
restore-keys: |
${{ runner.os }}-maven
- name: Show input
run: echo ${{ github.event.inputs.forceLatestFF }}
- name: Force using the latest F!F version
if: ${{ github.event.inputs.forceLatestFF }}
run: rm -rf download/metadata
- name: Configure another port
run: echo "tomcat.port=8091" > examples/${{ matrix.example }}/frank-runner.properties
# From https://github.com/actions/virtual-environments/issues/1187, but the -o option mentioned there did not work
- name: Configure another SSL port
run: echo "tomcat.secure.port=8443" >> examples/${{ matrix.example }}/frank-runner.properties
- name: Check network
run: time ping -c 4 -O -v -w 60 localhost
- name: Start Frank!Runner ${{ matrix.example }}
run: bash ./restart.sh &
working-directory: examples/${{ matrix.example }}
- name: Wait until Frank!Framework is up
run: bash .github/workflows/waitForUrl.sh http://localhost:8091/iaf/api/server/health 500
- name: Wait, otherwise we fail with status STARTING
run: sleep 10s
- name: Capture status
id: captureStatus
uses: fjogeleit/http-request-action@v1
with:
method: GET
url: "http://localhost:8091/iaf/api/server/health"
- name: Analyze status
uses: actions/github-script@v6
with:
script: |
let rawStatus = '${{ steps.captureStatus.outputs.response }}'
core.info('Captured status: ' + rawStatus)
let status = JSON.parse(rawStatus)
if(! status.status) {
core.setFailed('Response has no field "status"')
} else if(status.status !== 'OK') {
core.setFailed('Field "status" is not "OK"')
} else {
core.info('status is OK');
}
- name: Store Apache Tomcat log
uses: actions/upload-artifact@v3
if: always()
with:
name: Linux-${{ matrix.example}}-logs
path: build/*/logs
- name: Check existence of FrankConfig.xsd - for classes
if: ${{ matrix.example == 'Frank2Example2' }}
run: test -e examples/${{ matrix.example }}/FrankConfig.xsd
- name: Check existence of FrankConfig.xsd - for configurations
if: ${{ (matrix.example == 'Frank2Example1') || (matrix.example == 'Frank2Example3') }}
run: test -e examples/${{ matrix.example }}/configurations/FrankConfig.xsd
- name: Check existence of FrankConfig.xsd - for Maven project
if: ${{ matrix.example == 'Frank2Example4' }}
run: test -e examples/${{ matrix.example }}/src/main/configurations/FrankConfig.xsd
- name: Show files
run: tree -L 5 .
if: always()
testing-windows:
strategy:
matrix:
example: [Frank2Example1, Frank2Example2, Frank2Example3, Frank2Example4]
name: Test windows ${{ matrix.example }}
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache Frank!Runner dependencies - build
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-frank-runner-build
restore-keys: |
${{ runner.os }}-frank-runner-build
- name: Cache Frank!Runner dependencies - download
uses: actions/cache@v3
with:
path: download
key: ${{ runner.os }}-frank-runner-download
restore-keys: |
${{ runner.os }}-frank-runner-download
- name: Cache Maven downloads
uses: actions/cache@v3
with:
path: ~/.m2/repository/
key: ${{ runner.os }}-maven
restore-keys: |
${{ runner.os }}-maven
- name: Force using the latest F!F version
if: ${{ github.event.inputs.forceLatestFF }}
shell: cmd
run: if exist download\metadata rmdir /S /Q download\metadata
- name: Configure another port
run: echo "tomcat.port=8091" > examples\${{ matrix.example }}\frank-runner.properties
- name: Configure another SSL port
run: echo "tomcat.secure.port=8443" >> examples\${{ matrix.example }}\frank-runner.properties
- name: Start Frank!Runner ${{ matrix.example }}
run: cmd /C .\restart.bat
working-directory: examples\${{ matrix.example }}
- name: Wait until Frank!Framework is up
run: .github\workflows\waitForUrl.bat http://localhost:8091/iaf/api/server/health 500
- name: Wait, otherwise we fail with status STARTING
run: Start-Sleep -s 10
shell: powershell
- name: Capture status
id: captureStatus
uses: fjogeleit/http-request-action@v1
with:
method: GET
url: "http://localhost:8091/iaf/api/server/health"
- name: Analyze status
uses: actions/github-script@v6
with:
script: |
let rawStatus = '${{ steps.captureStatus.outputs.response }}'
core.info('Captured status: ' + rawStatus)
let status = JSON.parse(rawStatus)
if(! status.status) {
core.setFailed('Response has no field "status"')
} else if(status.status !== 'OK') {
core.setFailed('Field "status" is not "OK"')
} else {
core.info('status is OK');
}
- name: Store Apache Tomcat log
uses: actions/upload-artifact@v3
if: always()
with:
name: Windows-${{ matrix.example}}-logs
path: build\*\logs
- name: Check that FrankConfig.xsd exists - for classes
if: ${{ matrix.example == 'Frank2Example2' }}
shell: cmd
run: if not exist examples\${{ matrix.example }}\FrankConfig.xsd ( exit /b 1 )
- name: Check that FrankConfig.xsd exists - for configurations
if: ${{ (matrix.example == 'Frank2Example1') || (matrix.example == 'Frank2Example3') }}
shell: cmd
run: if not exist examples\${{ matrix.example }}\configurations\FrankConfig.xsd ( exit /b 1 )
- name: Check that FrankConfig.xsd exists - for Maven project
if: ${{ matrix.example == 'Frank2Example4' }}
shell: cmd
run: if not exist examples\${{ matrix.example }}\src\main\configurations\FrankConfig.xsd ( exit /b 1 )
- name: Show files
run: tree /A /F
if: always()