-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (170 loc) · 5.87 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
name: Ubuntu Workflow
on:
pull_request:
branches: [ gcos4gnucobol-3.x ]
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
include:
- os: ubuntu-latest
skip_test: true
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
- 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: Set git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- 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 --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.log
uses: actions/upload-artifact@v3
if: failure()
with:
name: config.log
path: _build/config.log
- name: make
run: |
cd _build
make --jobs=$(($(nproc)+1))
# - name: check
# run: |
# cd _build
# make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
# note: distcheck also creates the dist tarball
- name: distcheck
run: |
cd _build
make --jobs=$(($(nproc)+1)) distcheck TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
- name: Upload testsuite.log
uses: actions/upload-artifact@v3
if: failure()
with:
# Assume there's only one directory matching `_build/gnucobol-*`:
name: testsuite.log
path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log
- name: Upload dist tarball
uses: actions/[email protected]
with:
name: gnucobol-ci source distribution
path: _build/gnucobol*.tar*
if-no-files-found: error
retention-days: 0
- name: Cache newcob.val.Z
uses: actions/cache@v3
id: newcob
with:
path: _build/tests/cobol85/newcob.val.Z.cached
key: newcob
- name: Download newcob.val.Z
if: steps.newcob.outputs.cache-hit != 'true'
run: |
cd _build/tests/cobol85
make newcob.val.Z
ln -f newcob.val.Z newcob.val.Z.cached
- name: NIST85 Test Suite
run: |
cd _build/tests/cobol85
ln -f newcob.val.Z.cached newcob.val.Z
make EXEC85 && make --jobs=$(($(nproc)+1)) test
- uses: actions/upload-artifact@v3
with:
name: NIST85 results
path: |
_build/tests/cobol85/**/*.log
_build/tests/cobol85/**/*.out
- name: install
run: |
cd _build
make install
coverage:
name: Coverage and Warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# 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
- name: configure
run: |
cd _build
../configure --enable-code-coverage CPPFLAGS="-Werror=declaration-after-statement"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: config.log
path: _build/config.log
- name: make
run: |
cd _build
make --jobs=$(($(nproc)+1))
- name: coverage
run: |
cd _build
make check-code-coverage TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: testsuite.log
path: _build/tests/testsuite.log
- uses: actions/upload-artifact@v3
with:
name: coverage
path: _build/GnuCOBOL-**-coverage/
- 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)