-
Notifications
You must be signed in to change notification settings - Fork 11
293 lines (251 loc) · 10.5 KB
/
opendatacon.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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
name: opendatacon workflow
on:
push:
branches:
- '**' # matches every branch
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches:
- '**'
jobs:
opendatacon-dockerfile-builds:
name: ${{matrix.name}}
strategy:
fail-fast: false
matrix:
include:
- name: Debian 12 Bookworm Release
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Release
docker-args:
setup-cmds:
- name: Debian 12 Bookworm Debug
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Debug
docker-args:
setup-cmds:
- name: Debian 12 Bookworm 32bit Release
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Release
docker-args: --build-arg DOCKER_ARCH='i386/' --build-arg CMAKE_OPTIONS='-DARCH_DESC=x86'
setup-cmds:
- name: Debian 12 Bookworm 32bit Debug
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Debug
docker-args: --build-arg DOCKER_ARCH='i386/' --build-arg CMAKE_OPTIONS='-DARCH_DESC=x86'
setup-cmds:
- name: Raspbian Bookworm Release
run-os: ubuntu-latest
docker-file: RaspbianBookworm
build-type: Release
docker-args:
setup-cmds: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Raspbian Bookworm Debug
run-os: ubuntu-latest
docker-file: RaspbianBookworm
build-type: Debug
docker-args:
setup-cmds: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Oracle Enterprise Linux 7 Release
run-os: ubuntu-latest
docker-file: OEL7
build-type: Release
docker-args:
setup-cmds:
- name: Oracle Enterprise Linux 7 Debug
run-os: ubuntu-latest
docker-file: OEL7
build-type: Debug
docker-args:
setup-cmds:
runs-on: ${{ matrix.run-os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Upload release text
run: git tag -l --format='%(contents)' $(git describe) > tag_annotation.txt
- name: Run Setup Commands
run: ${{ matrix.setup-cmds }}
- name: Dockerfile Build
run: |
docker build \
--build-arg BUILD_TYPE=${{ matrix.build-type }} \
--build-arg BUILD_COMMIT=${{ github.sha }} \
${{ matrix.docker-args }} \
--output type=local,dest=./ \
-t opendatacon-builder -f DockerFiles/${{ matrix.docker-file }} .
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }} Installer
retention-days: 7
path: |
opendatacon-*.sh
opendatacon-*.exe
tag_annotation.txt
- name: Upload Logs
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.run-os }} Logs
retention-days: 7
path: |
ODC_Log*
opendatacon-native:
name: ${{matrix.os}} ${{matrix.build-type}} ${{matrix.bits}}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
build-type: [Release,Debug]
bits: [64]
include:
- os: windows-latest
build-type: Release
bits: 32
cross: 'none'
- os: windows-latest
build-type: Debug
bits: 32
cross: 'none'
runs-on: ${{ matrix.os }}
env:
BUILD_TYPE: ${{ matrix.build-type }}
INSTALL_PREFIX: ${{github.workspace}}/build/install
JOB_NAME: ${{matrix.os}}_${{matrix.build-type}}_${{matrix.bits}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- if: matrix.bits == 32 && contains(matrix.os,'windows') #FIXME: openssl version pinned to 1.1.1 because 3.x choco doesn't support 32bit
name: Set 32-bit env
run: |
echo 'BITPLAT=x86' >> $env:GITHUB_ENV
echo 'BITGEN=-AWin32' >> $env:GITHUB_ENV
choco install openssl --version=1.1.1.2100 --x86
Remove-Item 'C:\hostedtoolcache\windows\Python\3.7.9\x64' -Recurse
echo "C:\hostedtoolcache\windows\Python\3.7.9\x86" >> $env:GITHUB_PATH
Copy-Item -Path ${{github.workspace}}/Code/Ports/PyPort/x86/python37_d.dll -Destination C:\Windows\sysWOW64\
- if: matrix.bits == 64 && contains(matrix.os,'windows')
name: Set 64-bit env
run: |
echo 'BITPLAT=x64' >> $env:GITHUB_ENV
echo 'BITGEN=-Ax64' >> $env:GITHUB_ENV
choco install openssl
Copy-Item -Path ${{github.workspace}}/Code/Ports/PyPort/x64/python37_d.dll -Destination C:\Windows\system32\
- if: contains(matrix.os,'windows')
name: Setup Windows Environment
run: |
If (-not (Test-Path C:\libmodbus\libmodbus)){
Invoke-WebRequest -OutFile libmodbus.zip "https://www.dropbox.com/s/iqf95y9x1x4ol36/libmodbus.zip?dl=1"
7z x -y libmodbus.zip
New-Item C:\libmodbus -ItemType Directory
Move-Item .\libmodbus C:\libmodbus\libmodbus
}
#hack because debug lib aint available!
Copy-Item -Path ${{github.workspace}}/Code/Ports/PyPort/${{env.BITPLAT}}/python37_d.lib -Destination C:/hostedtoolcache/windows/Python/3.7.9/${{env.BITPLAT}}/libs/
echo 'TOOLCHAIN_OPT=-G"Visual Studio 17 2022" ${{env.BITGEN}} -DCMAKE_CONFIGURATION_TYPES=${{env.BUILD_TYPE}} -DMODBUS_HOME=c:\libmodbus\libmodbus\windows${{matrix.bits}} -DPYTHON_HOME=C:\hostedtoolcache\windows\Python\3.7.9\${{env.BITPLAT}}' >> $env:GITHUB_ENV
- if: contains(matrix.os,'macos')
name: Setup MacOS Environment
run: |
brew install libmodbus socat
echo 'TOOLCHAIN_OPT=-DPACKAGE_DNP3=OFF -DPACKAGE_LIBMODBUS=OFF -DPACKAGE_PYTHON=OFF -DPACKAGE_DNP3=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 -DPYTHON_HOME=/opt -DMODBUS_HOME=/opt/homebrew' >> $GITHUB_ENV
echo 'BINDIR=bin/' >> $GITHUB_ENV
- name: Upload release text
run: git tag -l --format='%(contents)' $(git describe) > tag_annotation.txt
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}} ${{env.TOOLCHAIN_OPT}} ${{env.SYSVER_OPT}} -DFULL=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 8
- name: Package
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package
- name: Install
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install
- name: ODC_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}ODC_tests ${{env.LOG_LVL}} -d yes
- name: libLua_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}libLua_tests ${{env.LOG_LVL}} -d yes
- name: DNP3Port_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}DNP3Port_tests ${{env.LOG_LVL}} -d yes
- name: SimPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}SimPort_tests -d yes
- name: KafkaPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}KafkaPort_tests ${{env.LOG_LVL}} -d yes
- name: MD3Port_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}MD3Port_tests ${{env.LOG_LVL}} -d yes
- name: CBPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}CBPort_tests ${{env.LOG_LVL}} -d yes
- name: PyPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}PyPort_tests ${{env.LOG_LVL}} -d yes
- name: FileTransferPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}FileTransferPort_tests ${{env.LOG_LVL}} -d yes
- name: LuaPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}LuaPort_tests ${{env.LOG_LVL}} -d yes
- name: Integration_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}Integration_tests ${{env.LOG_LVL}} -d yes
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: ${{env.JOB_NAME}} Installer
retention-days: 7
path: |
build/opendatacon-*.sh
build/opendatacon-*.exe
tag_annotation.txt
- name: Upload Logs
uses: actions/upload-artifact@v4
with:
name: ${{env.JOB_NAME}} Logs
retention-days: 7
path: |
ODC_Log*
opendatacon-deploy:
if: always() && contains(github.ref, 'tag')
needs: [opendatacon-native,opendatacon-dockerfile-builds]
runs-on: macos-latest
steps:
- name: Download Installers
uses: actions/download-artifact@v4
with:
path: installers
pattern: '*Installer'
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
body_path: tag_annotation.txt
files: |
**/opendatacon-*.*.*-*-*-*-*-*.sh
**/opendatacon-*.*.*-*-*-*-*-*.exe
fail_on_unmatched_files: false
token: ${{ secrets.GITHUB_TOKEN }}
opendatacon-clean:
if: github.event_name != 'pull_request'
needs: [opendatacon-native,opendatacon-dockerfile-builds]
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