Skip to content

Commit 7cc3bbe

Browse files
authored
Merge pull request #225 from ddeclerck/gc4_ci_update
[GC4] Update CIs
2 parents 257b897 + 3e67787 commit 7cc3bbe

File tree

4 files changed

+243
-50
lines changed

4 files changed

+243
-50
lines changed

.github/workflows/build_nightly.yml

Lines changed: 191 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
jobs:
1111
build:
12+
name: Build, test and provide nightly
1213
runs-on: ubuntu-latest
1314
timeout-minutes: 10
1415
strategy:
@@ -37,20 +38,45 @@ jobs:
3738
sudo apt -y install autoconf automake make libtool flex bison \
3839
autopoint gettext help2man texinfo texlive \
3940
gcc libgmp-dev libncurses-dev \
40-
libdb-dev libxml2-dev libcjson-dev
41+
libdb5.3-dev libxml2-dev libcjson-dev
4142
42-
- name: Install VISAM
43+
- name: Restore VISAM cache
4344
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' }}
4454
run: |
4555
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
5068
echo "CPATH=/opt/visam/include" >> $GITHUB_ENV
5169
echo "LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
5270
echo "LD_LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
5371
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+
5480
- name: Bootstrap GnuCOBOL
5581
run: ./build_aux/bootstrap install
5682

@@ -60,17 +86,19 @@ jobs:
6086
../configure --with-${{ matrix.isam }} \
6187
--with-indexed=${{ matrix.isam }} \
6288
--enable-cobc-internal-checks \
63-
--enable-hardening
89+
--enable-hardening \
90+
--prefix=/opt/gnucobol \
91+
--with-pkgversion="GnuCOBOL CI"
6492
echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" >> $GITHUB_ENV
6593
6694
- name: Build GnuCOBOL
6795
run: make -C _build --jobs=$(($(nproc)+1))
6896

69-
- name: Upload config-${{ matrix.isam }}.log
97+
- name: Upload config.log
7098
if: ${{ !cancelled() }}
7199
uses: actions/upload-artifact@v4
72100
with:
73-
name: config-${{ matrix.isam }}.log
101+
name: config-${{ github.job }}-${{ matrix.isam }}.log
74102
path: _build/config.log
75103

76104
# note: distcheck also creates the dist tarball
@@ -83,11 +111,11 @@ jobs:
83111
make -C _build --jobs=$(($(nproc)+1)) dist DIST_TARGETS="dist-gzip distwin-zip"
84112
make -C _build --jobs=$(($(nproc)+1)) distbin DISTBIN_TARGETS="distbin-xz"
85113
86-
- name: Upload testsuite-${{ matrix.isam }}.log
114+
- name: Upload testsuite.log
87115
if: ${{ !cancelled() }}
88116
uses: actions/upload-artifact@v4
89117
with:
90-
name: testsuite-${{ matrix.isam }}.log
118+
name: testsuite-${{ github.job }}-${{ matrix.isam }}.log
91119
path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log
92120

93121
- name: Upload dist tarball
@@ -131,7 +159,136 @@ jobs:
131159
if: ${{ !cancelled() }}
132160
uses: actions/upload-artifact@v4
133161
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 }}
135292
path: |
136293
_build/tests/cobol85/summary.*
137294
_build/tests/cobol85/**/*.log
@@ -140,6 +297,7 @@ jobs:
140297
141298
142299
minmal_build:
300+
name: Build and test with minimal dependencies
143301
needs: build
144302
runs-on: ubuntu-latest
145303
timeout-minutes: 10
@@ -172,23 +330,23 @@ jobs:
172330
- name: Build GnuCOBOL
173331
run: make -C _build --jobs=$(($(nproc)+1))
174332

175-
- name: Upload config-minimal.log
333+
- name: Upload config.log
176334
if: ${{ !cancelled() }}
177335
uses: actions/upload-artifact@v4
178336
with:
179-
name: config-minimal.log
337+
name: config-${{ github.job }}.log
180338
path: _build/config.log
181339

182340
- name: Run testsuite
183341
run: |
184342
make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
185343
make -C _build check TESTSUITEFLAGS="--recheck --verbose"
186344
187-
- name: Upload testsuite-minimal.log
345+
- name: Upload testsuite.log
188346
if: ${{ !cancelled() }}
189347
uses: actions/upload-artifact@v4
190348
with:
191-
name: testsuite-minimal.log
349+
name: testsuite-${{ github.job }}.log
192350
path: _build/tests/testsuite.log
193351

194352
- name: Cache newcob.val
@@ -205,7 +363,7 @@ jobs:
205363
if: ${{ !cancelled() }}
206364
uses: actions/upload-artifact@v4
207365
with:
208-
name: NIST85 results on minimal
366+
name: NIST85 results on ${{ github.job }}
209367
path: |
210368
_build/tests/cobol85/summary.*
211369
_build/tests/cobol85/**/*.log
@@ -214,7 +372,11 @@ jobs:
214372
215373
216374
coverage:
375+
name: Coverage and Warnings
217376
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
218380
runs-on: ubuntu-22.04
219381
timeout-minutes: 10
220382

@@ -243,19 +405,19 @@ jobs:
243405
- name: Configure GnuCOBOL
244406
run: |
245407
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 \
248410
CPPFLAGS="-Werror=declaration-after-statement" \
249411
CC="gcc -std=c89"
250412
251413
- name: Build GnuCOBOL
252414
run: make -C _build --jobs=$(($(nproc)+1))
253415

254-
- name: Upload config-coverage.log
416+
- name: Upload config.log
255417
if: ${{ !cancelled() }}
256418
uses: actions/upload-artifact@v4
257419
with:
258-
name: config-coverage.log
420+
name: config-${{ github.job }}.log
259421
path: _build/config.log
260422

261423
- name: Coverage
@@ -265,18 +427,18 @@ jobs:
265427
make -C _build code-coverage-capture \
266428
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"
267429
268-
- name: Upload testsuite-coverage.log
430+
- name: Upload testsuite.log
269431
if: ${{ !cancelled() }}
270432
uses: actions/upload-artifact@v4
271433
with:
272-
name: testsuite-coverage.log
434+
name: testsuite-${{ github.job }}.log
273435
path: _build/tests/testsuite.log
274436

275437
- name: Upload coverage report
276438
uses: actions/upload-artifact@v4
277439
with:
278440
name: coverage
279-
path: _build/GnuCOBOL-**-coverage/
441+
path: _build/GnuCOBOL-**-coverage
280442

281443
- name: Cache newcob.val
282444
uses: actions/cache@v4
@@ -300,7 +462,7 @@ jobs:
300462
path: _build/extended-coverage
301463

302464
- name: Upload coverage to codecov
303-
uses: codecov/codecov-action@v2
465+
uses: codecov/codecov-action@v3
304466
with:
305467
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
306468
directory: _build
@@ -366,7 +528,6 @@ jobs:
366528
echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS-Debug --enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV
367529
}
368530
369-
370531
- name: Restore MSYS1 cache
371532
id: restore-msys
372533
uses: actions/cache/restore@v4
@@ -389,7 +550,7 @@ jobs:
389550
run: |
390551
rmdir /Q /S %MSYS_ROOT%\docs
391552
rmdir /Q /S %MSYS_ROOT%\var
392-
del /Q %MSYS_ROOT%\bin\gdb.exe
553+
del /Q %MSYS_ROOT%\bin\gdb*
393554
394555
- name: Save MSYS1 cache
395556
if: steps.restore-msys.outputs.cache-hit != 'true'
@@ -540,7 +701,7 @@ jobs:
540701
rem Note: the extra CPATH above is only required in debug builds
541702
rem (otherwise gcc invoked from cobc does not find libcob.h [pre-inst-env]), for some reason...
542703
543-
- name: Upload config-msys-${{ matrix.target }}.log
704+
- name: Upload config.log
544705
if: ${{ !cancelled() }}
545706
uses: actions/upload-artifact@v4
546707
with:
@@ -589,7 +750,7 @@ jobs:
589750
rem Note: the extra CPATH above is only required in debug builds
590751
rem (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason...
591752
592-
- name: Upload testsuite-msys-${{ matrix.target }}.log
753+
- name: Upload testsuite.log
593754
if: ${{ !cancelled() }}
594755
uses: actions/upload-artifact@v4
595756
with:
@@ -599,7 +760,7 @@ jobs:
599760
- name: Package GnuCOBOL MinGW nightly
600761
run: bash -lc "make -C _build distmingw"
601762

602-
- name: Upload GnuCOBOL_mingw-${{ matrix.target }}
763+
- name: Upload GnuCOBOL_mingw
603764
uses: actions/upload-artifact@v4
604765
with:
605766
name: GnuCOBOL_mingw-${{ matrix.target }}

0 commit comments

Comments
 (0)