9
9
10
10
jobs :
11
11
build :
12
+ name : Build, test and provide nightly
12
13
runs-on : ubuntu-latest
13
14
timeout-minutes : 10
14
15
strategy :
@@ -37,20 +38,45 @@ jobs:
37
38
sudo apt -y install autoconf automake make libtool flex bison \
38
39
autopoint gettext help2man texinfo texlive \
39
40
gcc libgmp-dev libncurses-dev \
40
- libdb -dev libxml2-dev libcjson-dev
41
+ libdb5.3 -dev libxml2-dev libcjson-dev
41
42
42
- - name : Install VISAM
43
+ - name : Restore VISAM cache
43
44
if : ${{ matrix.isam == 'visam' }}
45
+ id : restore-visam
46
+ uses : actions/cache/restore@v4
47
+ with :
48
+ key : cache-visam
49
+ path : visam
50
+
51
+ - name : Build VISAM
52
+ if : ${{ matrix.isam == 'visam' &&
53
+ steps.restore-visam.outputs.cache-hit != 'true' }}
44
54
run : |
45
55
curl -LO http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
46
- tar -xvzf visam-2.2.tar.Z
47
- cd visam-2.2
48
- ./configure --prefix=/opt/visam --enable-vbisamdefault
49
- make && sudo make install
56
+ mkdir visam && tar -xvzf visam-2.2.tar.Z -C visam --strip-components=1
57
+ cd visam
58
+ ./configure --prefix=/opt/visam --enable-vbisamdefault \
59
+ CFLAGS="-fstack-protector-strong -fstack-clash-protection -ggdb3 -fasynchronous-unwind-tables" \
60
+ LDFLAGS="-fstack-protector-strong -fstack-clash-protection" \
61
+ CPPFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
62
+ make --jobs=$(($(nproc)+1))
63
+
64
+ - name : Install VISAM
65
+ if : ${{ matrix.isam == 'visam' }}
66
+ run : |
67
+ sudo make -C visam install
50
68
echo "CPATH=/opt/visam/include" >> $GITHUB_ENV
51
69
echo "LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
52
70
echo "LD_LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
53
71
72
+ - name : Save VISAM cache
73
+ if : ${{ matrix.isam == 'visam' &&
74
+ steps.restore-visam.outputs.cache-hit != 'true' }}
75
+ uses : actions/cache/save@v4
76
+ with :
77
+ key : cache-visam
78
+ path : visam
79
+
54
80
- name : Bootstrap GnuCOBOL
55
81
run : ./build_aux/bootstrap install
56
82
@@ -60,17 +86,19 @@ jobs:
60
86
../configure --with-${{ matrix.isam }} \
61
87
--with-indexed=${{ matrix.isam }} \
62
88
--enable-cobc-internal-checks \
63
- --enable-hardening
89
+ --enable-hardening \
90
+ --prefix=/opt/gnucobol \
91
+ --with-pkgversion="GnuCOBOL CI"
64
92
echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" >> $GITHUB_ENV
65
93
66
94
- name : Build GnuCOBOL
67
95
run : make -C _build --jobs=$(($(nproc)+1))
68
96
69
- - name : Upload config-${{ matrix.isam }} .log
97
+ - name : Upload config.log
70
98
if : ${{ !cancelled() }}
71
99
uses : actions/upload-artifact@v4
72
100
with :
73
- name : config-${{ matrix.isam }}.log
101
+ name : config-${{ github.job }}-${{ matrix.isam }}.log
74
102
path : _build/config.log
75
103
76
104
# note: distcheck also creates the dist tarball
@@ -83,11 +111,11 @@ jobs:
83
111
make -C _build --jobs=$(($(nproc)+1)) dist DIST_TARGETS="dist-gzip distwin-zip"
84
112
make -C _build --jobs=$(($(nproc)+1)) distbin DISTBIN_TARGETS="distbin-xz"
85
113
86
- - name : Upload testsuite-${{ matrix.isam }} .log
114
+ - name : Upload testsuite.log
87
115
if : ${{ !cancelled() }}
88
116
uses : actions/upload-artifact@v4
89
117
with :
90
- name : testsuite-${{ matrix.isam }}.log
118
+ name : testsuite-${{ github.job }}-${{ matrix.isam }}.log
91
119
path : _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log
92
120
93
121
- name : Upload dist tarball
@@ -131,7 +159,136 @@ jobs:
131
159
if : ${{ !cancelled() }}
132
160
uses : actions/upload-artifact@v4
133
161
with :
134
- name : NIST85 results on ${{ matrix.isam }}
162
+ name : NIST85 results on ${{ github.job }}-${{ matrix.isam }}
163
+ path : |
164
+ _build/tests/cobol85/summary.*
165
+ _build/tests/cobol85/**/*.log
166
+ _build/tests/cobol85/**/*.out
167
+ _build/tests/cobol85/**/duration.txt
168
+
169
+
170
+ build_clang :
171
+ name : Build, test and provide nightly (Clang)
172
+ runs-on : ubuntu-latest
173
+ timeout-minutes : 10
174
+ strategy :
175
+ fail-fast : false
176
+ matrix :
177
+ isam :
178
+ - db
179
+ - visam
180
+
181
+ steps :
182
+
183
+ - name : Set git user
184
+ run : |
185
+ git config --global user.name github-actions
186
+ git config --global user.email [email protected]
187
+
188
+ - name : Checkout code
189
+ uses : actions/checkout@v4
190
+
191
+ - name : Setup build environment
192
+ run : echo "TERM=vt100" >> $GITHUB_ENV
193
+
194
+ - name : Install packages
195
+ run : |
196
+ sudo apt -y update
197
+ sudo apt -y install autoconf automake make libtool flex bison \
198
+ autopoint gettext help2man texinfo texlive \
199
+ clang libgmp-dev libncurses-dev \
200
+ libdb5.3-dev libxml2-dev libcjson-dev
201
+
202
+ - name : Restore VISAM cache
203
+ if : ${{ matrix.isam == 'visam' }}
204
+ id : restore-visam
205
+ uses : actions/cache/restore@v4
206
+ with :
207
+ key : cache-visam-clang
208
+ path : visam
209
+
210
+ - name : Build VISAM
211
+ if : ${{ matrix.isam == 'visam' &&
212
+ steps.restore-visam.outputs.cache-hit != 'true' }}
213
+ run : |
214
+ curl -LO http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
215
+ mkdir visam && tar -xvzf visam-2.2.tar.Z -C visam --strip-components=1
216
+ cd visam
217
+ ./configure --prefix=/opt/visam --enable-vbisamdefault \
218
+ CC=clang \
219
+ CFLAGS="-fstack-protector-strong -fstack-clash-protection -ggdb3 -fasynchronous-unwind-tables" \
220
+ LDFLAGS="-fstack-protector-strong -fstack-clash-protection" \
221
+ CPPFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
222
+ make --jobs=$(($(nproc)+1))
223
+
224
+ - name : Install VISAM
225
+ if : ${{ matrix.isam == 'visam' }}
226
+ run : |
227
+ sudo make -C visam install
228
+ echo "CPATH=/opt/visam/include" >> $GITHUB_ENV
229
+ echo "LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
230
+ echo "LD_LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
231
+
232
+ - name : Save VISAM cache
233
+ if : ${{ matrix.isam == 'visam' &&
234
+ steps.restore-visam.outputs.cache-hit != 'true' }}
235
+ uses : actions/cache/save@v4
236
+ with :
237
+ key : cache-visam-clang
238
+ path : visam
239
+
240
+ - name : Bootstrap GnuCOBOL
241
+ run : ./build_aux/bootstrap install
242
+
243
+ - name : Configure GnuCOBOL
244
+ run : |
245
+ mkdir _build && cd _build
246
+ ../configure --with-${{ matrix.isam }} \
247
+ --with-indexed=${{ matrix.isam }} \
248
+ --enable-cobc-internal-checks \
249
+ --enable-hardening \
250
+ --prefix=/opt/gnucobol \
251
+ --with-pkgversion="GnuCOBOL CI" \
252
+ CC=clang
253
+ echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" >> $GITHUB_ENV
254
+
255
+ - name : Build GnuCOBOL
256
+ run : make -C _build --jobs=$(($(nproc)+1))
257
+
258
+ - name : Upload config.log
259
+ if : ${{ !cancelled() }}
260
+ uses : actions/upload-artifact@v4
261
+ with :
262
+ name : config-${{ github.job }}-${{ matrix.isam }}.log
263
+ path : _build/config.log
264
+
265
+ - name : Run testsuite
266
+ run : |
267
+ make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
268
+ make -C _build check TESTSUITEFLAGS="--recheck --verbose"
269
+
270
+ - name : Upload testsuite.log
271
+ if : ${{ !cancelled() }}
272
+ uses : actions/upload-artifact@v4
273
+ with :
274
+ name : testsuite-${{ github.job }}-${{ matrix.isam }}.log
275
+ path : _build/tests/testsuite.log
276
+
277
+ - name : Cache newcob.val
278
+ uses : actions/cache@v4
279
+ with :
280
+ path : _build/tests/cobol85/newcob.val
281
+ key : newcob-val
282
+ enableCrossOsArchive : true
283
+
284
+ - name : Run NIST85 testsuite
285
+ run : make -C _build test --jobs=$(($(nproc)+1))
286
+
287
+ - name : Upload NIST85 Test Suite results
288
+ if : ${{ !cancelled() }}
289
+ uses : actions/upload-artifact@v4
290
+ with :
291
+ name : NIST85 results on ${{ github.job }}-${{ matrix.isam }}
135
292
path : |
136
293
_build/tests/cobol85/summary.*
137
294
_build/tests/cobol85/**/*.log
@@ -140,6 +297,7 @@ jobs:
140
297
141
298
142
299
minmal_build :
300
+ name : Build and test with minimal dependencies
143
301
needs : build
144
302
runs-on : ubuntu-latest
145
303
timeout-minutes : 10
@@ -172,23 +330,23 @@ jobs:
172
330
- name : Build GnuCOBOL
173
331
run : make -C _build --jobs=$(($(nproc)+1))
174
332
175
- - name : Upload config-minimal .log
333
+ - name : Upload config.log
176
334
if : ${{ !cancelled() }}
177
335
uses : actions/upload-artifact@v4
178
336
with :
179
- name : config-minimal .log
337
+ name : config-${{ github.job }} .log
180
338
path : _build/config.log
181
339
182
340
- name : Run testsuite
183
341
run : |
184
342
make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
185
343
make -C _build check TESTSUITEFLAGS="--recheck --verbose"
186
344
187
- - name : Upload testsuite-minimal .log
345
+ - name : Upload testsuite.log
188
346
if : ${{ !cancelled() }}
189
347
uses : actions/upload-artifact@v4
190
348
with :
191
- name : testsuite-minimal .log
349
+ name : testsuite-${{ github.job }} .log
192
350
path : _build/tests/testsuite.log
193
351
194
352
- name : Cache newcob.val
@@ -205,7 +363,7 @@ jobs:
205
363
if : ${{ !cancelled() }}
206
364
uses : actions/upload-artifact@v4
207
365
with :
208
- name : NIST85 results on minimal
366
+ name : NIST85 results on ${{ github.job }}
209
367
path : |
210
368
_build/tests/cobol85/summary.*
211
369
_build/tests/cobol85/**/*.log
@@ -214,7 +372,11 @@ jobs:
214
372
215
373
216
374
coverage :
375
+ name : Coverage and Warnings
217
376
needs : build
377
+ # Since the latest Ubuntu image, lcov fails complaining about negative branch counts,
378
+ # and using fprofile-update=atomic as suggested does not help, so use the previous image
379
+ # runs-on: ubuntu-latest
218
380
runs-on : ubuntu-22.04
219
381
timeout-minutes : 10
220
382
@@ -243,19 +405,19 @@ jobs:
243
405
- name : Configure GnuCOBOL
244
406
run : |
245
407
mkdir _build && cd _build
246
- ../configure --with-db --with-indexed=db \
247
- --enable-code-coverage \
408
+ ../configure --enable-code-coverage \
409
+ --with-db --with-indexed=db --with-xml2 --with-json=cjson --with-curses=ncursesw \
248
410
CPPFLAGS="-Werror=declaration-after-statement" \
249
411
CC="gcc -std=c89"
250
412
251
413
- name : Build GnuCOBOL
252
414
run : make -C _build --jobs=$(($(nproc)+1))
253
415
254
- - name : Upload config-coverage .log
416
+ - name : Upload config.log
255
417
if : ${{ !cancelled() }}
256
418
uses : actions/upload-artifact@v4
257
419
with :
258
- name : config-coverage .log
420
+ name : config-${{ github.job }} .log
259
421
path : _build/config.log
260
422
261
423
- name : Coverage
@@ -265,18 +427,18 @@ jobs:
265
427
make -C _build code-coverage-capture \
266
428
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"
267
429
268
- - name : Upload testsuite-coverage .log
430
+ - name : Upload testsuite.log
269
431
if : ${{ !cancelled() }}
270
432
uses : actions/upload-artifact@v4
271
433
with :
272
- name : testsuite-coverage .log
434
+ name : testsuite-${{ github.job }} .log
273
435
path : _build/tests/testsuite.log
274
436
275
437
- name : Upload coverage report
276
438
uses : actions/upload-artifact@v4
277
439
with :
278
440
name : coverage
279
- path : _build/GnuCOBOL-**-coverage/
441
+ path : _build/GnuCOBOL-**-coverage
280
442
281
443
- name : Cache newcob.val
282
444
uses : actions/cache@v4
@@ -300,7 +462,7 @@ jobs:
300
462
path : _build/extended-coverage
301
463
302
464
- name : Upload coverage to codecov
303
- uses : codecov/codecov-action@v2
465
+ uses : codecov/codecov-action@v3
304
466
with :
305
467
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
306
468
directory : _build
@@ -366,7 +528,6 @@ jobs:
366
528
echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS-Debug --enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV
367
529
}
368
530
369
-
370
531
- name : Restore MSYS1 cache
371
532
id : restore-msys
372
533
uses : actions/cache/restore@v4
@@ -389,7 +550,7 @@ jobs:
389
550
run : |
390
551
rmdir /Q /S %MSYS_ROOT%\docs
391
552
rmdir /Q /S %MSYS_ROOT%\var
392
- del /Q %MSYS_ROOT%\bin\gdb.exe
553
+ del /Q %MSYS_ROOT%\bin\gdb*
393
554
394
555
- name : Save MSYS1 cache
395
556
if : steps.restore-msys.outputs.cache-hit != 'true'
@@ -540,7 +701,7 @@ jobs:
540
701
rem Note: the extra CPATH above is only required in debug builds
541
702
rem (otherwise gcc invoked from cobc does not find libcob.h [pre-inst-env]), for some reason...
542
703
543
- - name : Upload config-msys-${{ matrix.target }} .log
704
+ - name : Upload config.log
544
705
if : ${{ !cancelled() }}
545
706
uses : actions/upload-artifact@v4
546
707
with :
@@ -589,7 +750,7 @@ jobs:
589
750
rem Note: the extra CPATH above is only required in debug builds
590
751
rem (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason...
591
752
592
- - name : Upload testsuite-msys-${{ matrix.target }} .log
753
+ - name : Upload testsuite.log
593
754
if : ${{ !cancelled() }}
594
755
uses : actions/upload-artifact@v4
595
756
with :
@@ -599,7 +760,7 @@ jobs:
599
760
- name : Package GnuCOBOL MinGW nightly
600
761
run : bash -lc "make -C _build distmingw"
601
762
602
- - name : Upload GnuCOBOL_mingw-${{ matrix.target }}
763
+ - name : Upload GnuCOBOL_mingw
603
764
uses : actions/upload-artifact@v4
604
765
with :
605
766
name : GnuCOBOL_mingw-${{ matrix.target }}
0 commit comments