-
Notifications
You must be signed in to change notification settings - Fork 3
276 lines (231 loc) · 8.67 KB
/
MiniPlex.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: MiniPlex Workflow
on:
push:
branches:
- '**' # matches every branch
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches:
- '**'
jobs:
build-job:
name: ${{matrix.os}} ${{matrix.build-type}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build-type: [Release,Debug]
runs-on: ${{ matrix.os }}
env:
BUILD_TYPE: ${{ matrix.build-type }}
JOB_NAME: ${{matrix.os}}_${{matrix.build-type}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 8
- if: always()
name: Upload Exes
uses: actions/upload-artifact@v4
with:
name: MiniPlex_${{env.JOB_NAME}}_exe
retention-days: 7
path: |
${{github.workspace}}/build/MiniPlex
${{github.workspace}}/build/**/MiniPlex.exe
${{github.workspace}}/build/**/MiniPlex.pdb
${{github.workspace}}/build/ProtoConv
${{github.workspace}}/build/**/ProtoConv.exe
${{github.workspace}}/build/**/ProtoConv.pdb
LICENSE
NOTICE
README.md
RELEASE_NOTES
3rdPartyLicenses/LICENSE_1_0.txt
- if: always() && contains(matrix.os,'macos')
name: Mac Cats
run: |
brew install nmap socat
- if: always() && contains(matrix.os,'ubuntu')
name: Linux Cats
run: |
sudo apt-get install -y ncat socat
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Start Test Processes
shell: bash
run: |
build/MiniPlex -H -p 20000 &
build/MiniPlex -T -p 20001 -r 127.0.0.1 -t 50000 &
build/MiniPlex -P -p 20002 -r 127.0.0.1 -t 50000 &
build/MiniPlex -P -p 20003 -r 127.0.0.1 -t 50000 -B 127.0.0.1 -b 50001 &
socat pty,raw,echo=0,link=SerialEndpoint1 pty,raw,echo=0,link=SerialEndpoint2 &
socat pty,raw,echo=0,link=SerialEndpoint3 pty,raw,echo=0,link=SerialEndpoint4 &
socat pty,raw,echo=0,link=SerialEndpoint5 pty,raw,echo=0,link=SerialEndpoint6 &
socat pty,raw,echo=0,link=SerialEndpoint7 pty,raw,echo=0,link=SerialEndpoint8 &
sleep 0.5
build/ProtoConv -l 21000 -A 127.0.0.1 -r 21001 -D 12345 -s SerialEndpoint1 -s SerialEndpoint3 -s SerialEndpoint5 -s SerialEndpoint7 &
build/ProtoConv -l 22000 -A 127.0.0.1 -r 22001 -D 12345 -s SerialEndpoint8 -s SerialEndpoint6 -s SerialEndpoint4 -s SerialEndpoint2 &
build/ProtoConv -l 23000 -A 127.0.0.1 -r 23001 -p DNP3 -C 0 -T 127.0.0.1 -t 20000 &
sleep 0.5
build/ProtoConv -l 24000 -A 127.0.0.1 -r 24001 -p DNP3 -C 1 -T 127.0.0.1 -t 20000 &
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Test Hub Mode
run: |
Test/HubMode.sh 127.0.0.1 20000
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Test Trunk Mode
run: |
Test/TrunkMode.sh 50000 127.0.0.1 20001
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Test Prune Mode
run: |
Test/PruneMode.sh 50000 127.0.0.1 20002
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Test Permanent Branches
run: |
Test/PermanentBranches.sh 50000 50001 127.0.0.1 20003
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Test ProtoConv Delim
run: |
Test/ProtoConvInOut.pl Test/DNP3Hex.txt 21001 127.0.0.1 21000 22001 127.0.0.1 22000 /tmp/out.txt Test/DNP3Hex.txt
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Test ProtoConv DNP3
run: |
Test/ProtoConvInOut.pl Test/DNP3HexOutOfOrder.txt 23001 127.0.0.1 23000 24001 127.0.0.1 24000 /tmp/out.txt Test/DNP3Hex.txt
- if: ${{ always() && !contains(matrix.os,'windows') }}
name: Stop Test Processes
run: |
killall ProtoConv || true
killall socat || true
killall MiniPlex || true
musl-build-job:
name: linux-static ${{matrix.build-type}}
strategy:
fail-fast: false
matrix:
build-type: [Release,Debug]
runs-on: ubuntu-latest
env:
BUILD_TYPE: ${{ matrix.build-type }}
JOB_NAME: linux-static_${{matrix.build-type}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- if: matrix.build-type == 'Debug'
name: Set Debug Options
run: |
echo 'STRIP_OPTION=-V' >> $GITHUB_ENV
- name: Docker Build
run: |
docker build \
--build-arg BUILD_TYPE=${{env.BUILD_TYPE}} \
--build-arg STRIP_OPTION=${{env.STRIP_OPTION}} \
--build-arg BUILD_COMMIT=${{ github.sha }} \
-t miniplex \
-f DockerFiles/MuslBuilder .
- name: Copy Exe
run: |
mkdir build
docker run -v $(pwd)/build:/build miniplex:latest cp MiniPlex-bin/MiniPlex MiniPlex-bin/ProtoConv /build/
- if: always()
name: Upload Exes
uses: actions/upload-artifact@v4
with:
name: MiniPlex_${{env.JOB_NAME}}_exe
retention-days: 7
path: |
${{github.workspace}}/build/MiniPlex
${{github.workspace}}/build/ProtoConv
LICENSE
NOTICE
README.md
RELEASE_NOTES
3rdPartyLicenses/LICENSE_1_0.txt
- if: always()
name: Linux Cats
run: |
sudo apt-get install -y ncat socat
- if: always()
name: Start Test Processes
shell: bash
run: |
build/MiniPlex -H -p 20000 &
build/MiniPlex -T -p 20001 -r 127.0.0.1 -t 50000 &
build/MiniPlex -P -p 20002 -r 127.0.0.1 -t 50000 &
build/MiniPlex -P -p 20003 -r 127.0.0.1 -t 50000 -B 127.0.0.1 -b 50001 &
socat pty,raw,echo=0,link=SerialEndpoint1 pty,raw,echo=0,link=SerialEndpoint2 &
socat pty,raw,echo=0,link=SerialEndpoint3 pty,raw,echo=0,link=SerialEndpoint4 &
socat pty,raw,echo=0,link=SerialEndpoint5 pty,raw,echo=0,link=SerialEndpoint6 &
socat pty,raw,echo=0,link=SerialEndpoint7 pty,raw,echo=0,link=SerialEndpoint8 &
sleep 0.5
build/ProtoConv -l 21000 -A 127.0.0.1 -r 21001 -D 12345 -s SerialEndpoint1 -s SerialEndpoint3 -s SerialEndpoint5 -s SerialEndpoint7 &
build/ProtoConv -l 22000 -A 127.0.0.1 -r 22001 -D 12345 -s SerialEndpoint8 -s SerialEndpoint6 -s SerialEndpoint4 -s SerialEndpoint2 &
build/ProtoConv -l 23000 -A 127.0.0.1 -r 23001 -p DNP3 -C 0 -T 127.0.0.1 -t 20000 &
sleep 0.5
build/ProtoConv -l 24000 -A 127.0.0.1 -r 24001 -p DNP3 -C 1 -T 127.0.0.1 -t 20000 &
- if: always()
name: Test Hub Mode
run: |
Test/HubMode.sh 127.0.0.1 20000
- if: always()
name: Test Trunk Mode
run: |
Test/TrunkMode.sh 50000 127.0.0.1 20001
- if: always()
name: Test Prune Mode
run: |
Test/PruneMode.sh 50000 127.0.0.1 20002
- if: always()
name: Test Permanent Branches
run: |
Test/PermanentBranches.sh 50000 50001 127.0.0.1 20003
- if: always()
name: Test ProtoConv Delim
run: |
Test/ProtoConvInOut.pl Test/DNP3Hex.txt 21001 127.0.0.1 21000 22001 127.0.0.1 22000 /tmp/out.txt Test/DNP3Hex.txt
- if: always()
name: Test ProtoConv DNP3
run: |
Test/ProtoConvInOut.pl Test/DNP3HexOutOfOrder.txt 23001 127.0.0.1 23000 24001 127.0.0.1 24000 /tmp/out.txt Test/DNP3Hex.txt
- if: always()
name: Stop Test Processes
run: |
killall ProtoConv || true
killall socat || true
killall MiniPlex || true
deploy-job:
if: always() && contains(github.ref, 'tag')
needs: [build-job,musl-build-job]
runs-on: ubuntu-latest
steps:
- name: Download Exes
uses: actions/download-artifact@v4
- name: Zip Exes
run: |
find -name "MiniPlex_*_exe" | xargs -I{} zip -r {}_${{ github.ref_name }}.zip {}
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
files: |
*_exe_${{ github.ref_name }}.zip
fail_on_unmatched_files: false
token: ${{ secrets.GITHUB_TOKEN }}
clean-job:
if: always()
needs: [build-job,musl-build-job]
runs-on: ubuntu-latest
steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '1 week'
skip-recent: 5
skip-tags: false