-
-
Notifications
You must be signed in to change notification settings - Fork 233
340 lines (337 loc) · 11.1 KB
/
main.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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
name: Github CI
on:
push:
branches:
- master
- smoke/*
- gh/*
tags:
- '0.*.*'
- '0.*'
pull_request:
branches:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
#strategy:
# matrix:
# os: [ubuntu-14.04, ubuntu-18.04, ubuntu-20.04, ubuntu-latest]
jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 50
strategy:
fail-fast: true
matrix:
CONFIGURE_ARGS:
- CFLAGS="-O1 -fno-omit-frame-pointer -fsanitize=address -fno-var-tracking" --disable-bindings --disable-docs
- CC="clang"
- --enable-release
- --enable-gcov --disable-bindings --disable-docs CFLAGS="-O0 -g"
- --disable-write --disable-docs
- CFLAGS="-O2 -m32" --disable-bindings --disable-docs
- CFLAGS="-O2 -fno-omit-frame-pointer -fsanitize=undefined -fno-var-tracking" --disable-bindings --disable-docs --enable-check-less
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
#- name: setup-python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
- if: contains(matrix.CONFIGURE_ARGS, '-m32')
name: setup gcc-multilib
run: |
sudo apt-get -y update
sudo apt-get -y install gcc-multilib
#- name: setup-python-libxml2
# run: |
# python -m pip install --upgrade pip
# python -m pip install --upgrade libxml2-python3
- if: contains(matrix.CONFIGURE_ARGS, '--enable-release')
name: setup --enable-release
run: |
sudo apt-get -y update
sudo apt-get -y install texlive help2man libconvert-binary-c-perl shellcheck \
swig python3-dev python3-libxml2 libxml2-dev libpcre2-dev libpcre2-32-0 jq \
pkg-config shellcheck parallel rpmlint shfmt doxygen jing valgrind cppcheck gperf \
intltool
build-aux/install-libxslt
build-aux/install-pslib
- uses: hendrikmuhs/[email protected]
with:
create-symlink: true
key: ${{ github.job }}-${{ matrix.CONFIGURE_ARGS }}
- run: sh autogen.sh
- if: contains(matrix.CONFIGURE_ARGS, '-fsanitize=address')
name: Fix kernel mmap rnd bits for -fsanitize=address
run: |
# echo "-fsanitize=address run-time broken in latest ubuntu image update from March 10, 2024"
# https://github.com/actions/runner-images/issues/9491
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
sudo sysctl vm.mmap_rnd_bits=28
- run: ./configure ${{ matrix.CONFIGURE_ARGS }}
- if: ${{ !contains(matrix.CONFIGURE_ARGS, '--enable-release') }}
run: make -j
- if: ${{ !contains(matrix.CONFIGURE_ARGS, '--enable-gcov') && !contains(matrix.CONFIGURE_ARGS, '--enable-release') && startsWith(github.ref, 'refs/heads/') }}
run: make -j check
# run: |
# python -m pip install cpp-coveralls
# make gcov
# coveralls -e test -e bindings
- if: contains(matrix.CONFIGURE_ARGS, '--enable-gcov')
timeout-minutes: 65
name: Run make codecov if --enable-gcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: make codecov
continue-on-error: true
- if: contains(matrix.CONFIGURE_ARGS, '--enable-release')
name: Run make distcheck if --enable-release
run: |
make regen-dynapi
make distcheck
- if: contains(matrix.CONFIGURE_ARGS, '--enable-release') && startsWith(github.ref, 'refs/tags/')
name: Prep-Release
run: sha256sum libredwg-*.tar.* > dist.sha256
- if: contains(matrix.CONFIGURE_ARGS, '--enable-release') && startsWith(github.ref, 'refs/tags/')
name: Release
continue-on-error: true
uses: softprops/action-gh-release@v1
with:
body_path: dist.sha256
files: |
dist.sha256
libredwg-*.tar.*
ppc64-big-endian:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- run: sudo apt-get -y update && sudo apt-get -y install gcc-powerpc64-linux-gnu libc6-ppc64-cross qemu-system-ppc binfmt-support qemu-user qemu-user-binfmt
- uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- run: sh autogen.sh
- run: CC="ccache powerpc64-linux-gnu-gcc" ./configure --host=powerpc64-linux-gnu --disable-bindings --disable-python
- run: make -j
- run: cd /lib64 && sudo ln -s /usr/powerpc64-linux-gnu/lib/ld64.so.1
- run: make -j check-minimal
continue-on-error: true
mips32-big-endian:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- run: sudo apt-get -y update && sudo apt-get -y install gcc-mips-linux-gnu gcc-multilib-mips-linux-gnu
- uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- run: sh autogen.sh
- run: CC="ccache mips-linux-gnu-gcc" CFLAGS=-Os ./configure --host=mips-linux-gnu --disable-bindings --disable-python
- run: make -j
linux-cmake:
runs-on: ubuntu-latest
timeout-minutes: 20
#strategy:
# fail-fast: true
# matrix:
# CMAKE_ARGS:
# - ""
# - "-DLIBREDWG_LIBONLY=On -DLIBREDWG_DISABLE_JSON=On"
# - "-DLIBREDWG_DISABLE_WRITE=On"
steps:
- name: setup-python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- uses: hendrikmuhs/[email protected]
with:
create-symlink: true
key: ${{ github.job }}
- run: cmake -DLIBREDWG_LIBONLY=On -DCMAKE_C_COMPILER_LAUNCHER=ccache .
- run: make -j
- run: make -j test
- if: failure()
run: tar cfz cmake-failure.tgz Testing/Temporary/LastTest.log src/config.h
- if: failure()
uses: actions/upload-artifact@v3
with:
name: cmake-failure.tgz
path: cmake-failure.tgz
macOS:
name: macOS
runs-on: macOS-latest
steps:
- name: init
run: brew install autoconf automake libtool texinfo
- name: link texinfo
run: brew link texinfo --force
- name: setup-python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- uses: hendrikmuhs/[email protected]
with:
create-symlink: true
key: ${{ github.job }}
- run: sh autogen.sh
- run: ./configure --disable-bindings --disable-werror
- run: PATH="/usr/local/opt/texinfo/bin:$PATH" make
- run: PATH="/usr/local/opt/texinfo/bin:$PATH" make check
#- run: make distcheck
mingw:
name: mingw
runs-on: windows-latest
env:
MSYS2_DIR: msys64
MSYS2_ARCH: x86_64
MSYSTEM: MINGW64
ARCH: win64
PLATFORM: x64
#PATH: "C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%"
steps:
# see https://github.com/msys2/setup-msys2
- name: setup-msys2
uses: msys2/setup-msys2@v2
with:
path-type: minimal
update: true
install: >-
git
base-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-libtool
mingw-w64-x86_64-libiconv
mingw-w64-x86_64-libxml2
mingw-w64-x86_64-swig
mingw-w64-x86_64-python2
libtool
autoconf-wrapper
automake-wrapper
texinfo
gperf
mingw-w64-x86_64-perl
mingw-w64-x86_64-pcre2
- run: reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting" /f /v DontShowUI /d 1
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- shell: msys2 {0}
run: sh ./autogen.sh
continue-on-error: true
- shell: msys2 {0}
run: ./configure --disable-dependency-tracking --enable-check-less
- shell: msys2 {0}
run: make -j
- if: failure()
shell: msys2 {0}
run: make -C src dwg_api.i; tar cfz mingw-failure.tgz src/dwg_api.i src/config.h
- if: failure()
uses: actions/upload-artifact@v4
with:
name: mingw-failure.tgz
path: mingw-failure.tgz
- shell: msys2 {0}
run: make -j check
mingw-cmake:
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: setup-msys2
uses: msys2/setup-msys2@v2
with:
path-type: minimal
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- run: cmake -G "MinGW Makefiles" -DDISABLE_WERROR=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache .
- run: mingw32-make -j VERBOSE=1 | tee make.log
- if: failure()
run: tar cfz msys-failure.tgz make.log src/config.h
- if: failure()
uses: actions/upload-artifact@v4
with:
name: msys-failure.tgz
path: msys-failure.tgz
vs2019:
runs-on: windows-2019
timeout-minutes: 20
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release .
- run: cmake --build . --config Release
- run: copy Release/libredwg.dll test/unit-testing/Release/
- run: ctest . --output-on-failure
- if: failure()
run: tar cfz msvc-failure.tgz Testing/Temporary/LastTest.log src/config.h
- if: failure()
uses: actions/upload-artifact@v4
with:
name: msvc-failure.tgz
path: msvc-failure.tgz
vs2019-ninja:
runs-on: windows-2019
timeout-minutes: 20
#env:
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
# - run: choco install ninja
# use the preinstalled vcpkg from image
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
#- name: Setup vcpkg
# uses: lukka/run-vcpkg@v11
# with:
# vcpkgDirectory: C:/vcpkg
# doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
# vcpkgJsonGlob: 'vcpkg.json.in'
- name: cmake -G "Ninja"
shell: cmd
run: |
cmake -G "Ninja" . ^
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release ^
-DVERBOSE_CONFIGURE=ON ^
-DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_C_COMPILER=cl
- run: ninja
- run: copy libredwg.dll test\unit-testing\
- run: ctest . --output-on-failure