-
Notifications
You must be signed in to change notification settings - Fork 24
245 lines (210 loc) · 8.19 KB
/
ubuntu.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
name: Ubuntu
on:
pull_request:
branches: [ gc4 ]
push:
# manual run in actions tab - for all branches
workflow_dispatch:
jobs:
build:
name: Build, test and provide nightly
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
isam:
- db
- visam
runs-on: ${{ matrix.os }}
steps:
- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Checkout code
uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install automake libtool libdb5.3-dev libxml2-dev libcjson-dev \
bison flex help2man gettext texlive
- name: Installing VISAM prerequisite
if: ${{ matrix.isam == 'visam' }}
run: |
wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
tar -xvzf visam-2.2.tar.Z
cd visam-2.2
./configure --prefix=/usr/local/visam-2.2 --enable-vbisamdefault
make
sudo make install
echo "CPATH=/usr/local/visam-2.2/include" >> $GITHUB_ENV
echo "LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
- name: Bootstrap
run: |
./build_aux/bootstrap
# FIXME: With TERM="dumb" `make check` fails with:
# ...
# 571: ACCEPT OMITTED (SCREEN) FAILED (run_accept.at:307)
# ...
# 693: ON EXCEPTION clause of DISPLAY FAILED (run_misc.at:6335)
# 695: LINE/COLUMN 0 exceptions FAILED (run_misc.at:6414)
# 694: EC-SCREEN-LINE-NUMBER and -STARTING-COLUMN FAILED (run_misc.at:6376)
# ...
# Failure cases read: "Error opening terminal: unknown." on
# stderr, and exit with code 1.
#
# Another alternative is passing `--with-curses=no` to the
# configure script, yet distcheck does call configure too...
#
- name: Build environment setup
run: |
mkdir _build
export TERM="vt100"
echo "TERM=$TERM" >> $GITHUB_ENV
echo "INSTALL_PATH=$(pwd)/_install" >> $GITHUB_ENV
- name: Configure
run: |
cd _build
../configure --with-${{ matrix.isam }} \
--with-indexed=${{ matrix.isam }} \
--enable-cobc-internal-checks \
--enable-hardening \
--prefix ${INSTALL_PATH}
echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" \
>> $GITHUB_ENV
- name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/config.log
- name: Build
run: |
make -C _build --jobs=$(($(nproc)+1))
# note: distcheck also creates the dist tarball
- name: Build distribution archive & run tests
run: |
make -C _build distcheck \
TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" \
--jobs=$(($(nproc)+1)) || \
make -C _build/gnucobol-$VERSION/_build/sub/tests check \
TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
# Assume there's only one directory matching `_build/gnucobol-*`:
name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log
- name: Upload dist tarball
uses: actions/upload-artifact@v4
with:
name: gnucobol-ci source distribution (${{ matrix.isam }})
path: _build/gnucobol*.tar*
if-no-files-found: error
retention-days: 0
- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val
key: newcob-val
save-always: true
enableCrossOsArchive: true
- name: NIST85 Test Suite
run: |
make -C _build/tests/cobol85 EXEC85 test \
--jobs=$(($(nproc)+1))
- name: Upload NIST85 Test Suite results
uses: actions/upload-artifact@v4
with:
name: NIST85 results on ${{ matrix.os }} (${{ matrix.isam }})
path: |
_build/tests/cobol85/**/*.log
_build/tests/cobol85/**/*.out
coverage:
name: Coverage and Warnings
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# note: less dependencies as we don't generate a dist tarball, one additional for lcov
- name: Install dependencies
run: |
sudo apt-get install automake libtool libdb5.3-dev libxml2-dev \
libcjson-dev bison flex help2man gettext lcov
- name: Bootstrap
run: |
./build_aux/bootstrap
- name: Build environment setup
run: |
mkdir _build
export TERM="vt100"
echo "TERM=$TERM" >> $GITHUB_ENV
# note: w add additional C compiler syntax checks here to not need
# _another_ CI run
#
# TODO: try and pass -pedantic via CPPFLAGS
- name: Configure
run: |
cd _build
../configure --enable-code-coverage \
CPPFLAGS="-Werror=declaration-after-statement" \
CC="gcc -std=c89"
- name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/config.log
- name: Build
run: |
make -C _build --jobs=$(($(nproc)+1))
- name: Coverage
run: |
# make -C _build check-code-coverage # <- (ignores errors)
make -C _build check \
TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
make -C _build code-coverage-capture \
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"
- name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/tests/testsuite.log
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.isam }}
path: _build/GnuCOBOL-**-coverage/
- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val
key: newcob-val
save-always: true
enableCrossOsArchive: true
- name: Extended coverage
run: |
make -C _build/tests/cobol85 EXEC85 test \
--jobs=$(($(nproc)+1)) \
--keep-going
make -C _build code-coverage-capture \
CODE_COVERAGE_OUTPUT_DIRECTORY=extended-coverage \
CODE_COVERAGE_OUTPUT_FILE=extended-coverage.info \
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"
- name: Upload extended coverage report
uses: actions/upload-artifact@v4
with:
name: extended-coverage-${{ matrix.os }}-${{ matrix.isam }}
path: _build/extended-coverage
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: _build
# Shall fail until we have a working account on codecov.io
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)