Skip to content

Commit 137fb39

Browse files
authored
Merge pull request #215 from ddeclerck/gc4_ci_update
Update 4.x CI, mostly following 3.x CI
2 parents ec82d0d + 2f6d462 commit 137fb39

File tree

5 files changed

+751
-534
lines changed

5 files changed

+751
-534
lines changed

.github/workflows/macos.yml

Lines changed: 83 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MacOS
1+
name: MacOS Workflow
22

33
on:
44
pull_request:
@@ -7,134 +7,143 @@ on:
77
# manual run in actions tab - for all branches
88
workflow_dispatch:
99

10+
env:
11+
HOMEBREW_ROOT: /opt/homebrew/opt
12+
1013
jobs:
1114
build:
15+
#runs-on: macos-latest-large # macos 14, amd64
16+
runs-on: macos-latest # macos 14, arm64
17+
timeout-minutes: 10
1218
strategy:
1319
fail-fast: false
1420
matrix:
15-
os:
16-
# - macos-latest-large # macos 14, amd64
17-
- macos-latest # macos 14, arm64
1821
isam:
1922
- db
2023
- visam
2124

22-
runs-on: ${{ matrix.os }}
23-
2425
steps:
2526

26-
- name: Configure git
27-
run: git config --global core.symlinks false
28-
2927
- name: Set git user
3028
run: |
3129
git config --global user.name github-actions
3230
git config --global user.email github-actions-bot@users.noreply.github.com
3331
32+
# Why was this necessary ? Works fine without it...
33+
# - name: Configure git
34+
# run: git config --global core.symlinks false
35+
3436
- name: Checkout code
3537
uses: actions/checkout@v4
3638

39+
- name: Setup build environment
40+
run: |
41+
echo "TERM=vt100" >> $GITHUB_ENV
42+
echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV
43+
3744
- name: Install packages
3845
run: |
39-
brew install pkg-config automake libtool help2man texinfo bison berkeley-db@4 json-c
40-
opt="/opt/homebrew/opt"
41-
echo "$opt/pkg-config/bin" >> $GITHUB_PATH
42-
echo "$opt/bison/bin" >> $GITHUB_PATH
43-
echo "LDFLAGS=-L$opt/berkeley-db@4/lib ${LDFLAGS}" >> $GITHUB_ENV
44-
echo "CPPFLAGS=-I$opt/berkeley-db@4/include ${CPPFLAGS}" >> $GITHUB_ENV
45-
46-
- name: Installing VISAM prerequisite
46+
brew update
47+
brew install autoconf automake libtool bison \
48+
help2man texinfo \
49+
berkeley-db@4 json-c
50+
echo "$HOMEBREW_ROOT/bison/bin" >> $GITHUB_PATH
51+
echo "LDFLAGS=-L$HOMEBREW_ROOT/berkeley-db@4/lib ${LDFLAGS}" >> $GITHUB_ENV
52+
echo "CPPFLAGS=-I$HOMEBREW_ROOT/berkeley-db@4/include ${CPPFLAGS}" >> $GITHUB_ENV
53+
54+
- name: Install VISAM
4755
if: ${{ matrix.isam == 'visam' }}
4856
run: |
49-
wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
57+
curl -LO http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
5058
tar -xvzf visam-2.2.tar.Z
5159
cd visam-2.2
52-
./configure --prefix=/usr/local/visam-2.2 --enable-vbisamdefault
60+
./configure --prefix=/opt/visam --enable-vbisamdefault
5361
chmod u+x build_aux/install-sh
54-
make
55-
sudo make install
56-
echo "CPATH=/usr/local/visam-2.2/include" >> $GITHUB_ENV
57-
echo "LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
58-
echo "LD_LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
62+
make && sudo make install
63+
echo "CPATH=/opt/visam/include" >> $GITHUB_ENV
64+
echo "LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
65+
echo "LD_LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV
5966
60-
- name: bootstrap
61-
run: |
62-
./build_aux/bootstrap install
63-
64-
- name: Build environment setup
65-
run: |
66-
mkdir _build
67-
echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV
68-
export TERM="vt100"
69-
echo "TERM=$TERM" >> $GITHUB_ENV
67+
- name: Bootstrap GnuCOBOL
68+
run: ./build_aux/bootstrap install
7069

71-
- name: configure
70+
- name: Configure GnuCOBOL
7271
run: |
73-
cd _build
74-
export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS"
75-
export CFLAGS="-Wno-unused-command-line-argument -Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS"
72+
mkdir _build && cd _build
7673
../configure --with-${{ matrix.isam }} \
7774
--with-indexed=${{ matrix.isam }} \
7875
--enable-cobc-internal-checks \
7976
--enable-hardening \
80-
--prefix /opt/cobol/gnucobol
77+
--prefix=/opt/cobol/gnucobol \
78+
CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS" \
79+
CFLAGS="-Wno-unused-command-line-argument -Wno-parentheses-equality $CFLAGS"
80+
81+
- name: Build GnuCOBOL
82+
run: make -C _build --jobs=$((${NPROC}+1))
8183

82-
- name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
84+
- name: Upload config-${{ matrix.isam }}.log
85+
if: ${{ !cancelled() }}
8386
uses: actions/upload-artifact@v4
84-
if: failure()
8587
with:
86-
name: config-${{ matrix.os }}-${{ matrix.isam }}.log
88+
name: config-${{ matrix.isam }}.log
8789
path: _build/config.log
8890

89-
- name: make
90-
run: |
91-
make -C _build --jobs=$((${NPROC}+1))
92-
93-
# make install must be done before make check, otherwis
94-
# execution of generated COBOL files fail for a missing
95-
# /usr/local/lib/libcob.dylib
96-
- name: make install
91+
# make install must be done before make check, otherwise execution of
92+
# generated COBOL files fail for a missing /usr/local/lib/libcob.dylib
93+
- name: Install GnuCOBOL
9794
run: |
9895
sudo make -C _build install
9996
find /opt/cobol > _build/install.log
10097
101-
- name: Upload install-${{ matrix.os }}-${{ matrix.isam }}.log
98+
- name: Upload install-${{ matrix.isam }}.log
10299
uses: actions/upload-artifact@v4
103100
with:
104-
name: install-${{ matrix.os }}-${{ matrix.isam }}.log
101+
name: install-${{ matrix.isam }}.log
105102
path: _build/install.log
106103

107-
- name: check
104+
- name: Adjust testsuite
105+
run: |
106+
cd tests/testsuite.src
107+
sed -i '' '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL \+ KEYCHECK\])/a \
108+
AT_SKIP_IF(\[true\])' run_file.at
109+
sed -i '' '/AT_SETUP(\[EXTFH: using ISAM callback\])/a \
110+
AT_SKIP_IF(\[true\])' run_file.at
111+
sed -i '' '/AT_SETUP(\[trace feature\])/a \
112+
AT_SKIP_IF(\[true\])' run_file.at
113+
sed -i '' '/AT_SETUP(\[trace feature with subroutine\])/a \
114+
AT_SKIP_IF(\[true\])' run_file.at
115+
sed -i '' '/AT_SETUP(\[trace feature with indexed EXTFH\])/a \
116+
AT_SKIP_IF(\[true\])' run_file.at
117+
118+
- name: Run testsuite
108119
run: |
109-
sed -i '' '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL \+ KEYCHECK\])/a\
110-
AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
111-
sed -i '' '/AT_SETUP(\[EXTFH: using ISAM callback\])/a\
112-
AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
113-
sed -i '' '/AT_SETUP(\[trace feature\])/a\
114-
AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
115-
sed -i '' '/AT_SETUP(\[trace feature with subroutine\])/a\
116-
AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
117-
sed -i '' '/AT_SETUP(\[trace feature with indexed EXTFH\])/a\
118-
AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
119-
make -C _build check \
120-
TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"
121-
122-
- name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
120+
make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" || \
121+
make -C _build check TESTSUITEFLAGS="--recheck --verbose"
122+
123+
- name: Upload testsuite-${{ matrix.isam }}.log
124+
if: ${{ !cancelled() }}
123125
uses: actions/upload-artifact@v4
124-
if: failure()
125126
with:
126-
name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
127+
name: testsuite-${{ matrix.isam }}.log
127128
path: _build/tests/testsuite.log
128129

129130
- name: Cache newcob.val
130131
uses: actions/cache@v4
131132
with:
132133
path: _build/tests/cobol85/newcob.val
133134
key: newcob-val
134-
save-always: true
135135
enableCrossOsArchive: true
136136

137-
- name: NIST85 Test Suite
138-
run: |
139-
make -C _build/tests/cobol85 EXEC85 test \
140-
--jobs=$((${NPROC}+1))
137+
- name: Run NIST85 testsuite
138+
run: make -C _build test --jobs=$((${NPROC}+1))
139+
140+
- name: Upload NIST85 Test Suite results
141+
if: ${{ !cancelled() }}
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: NIST85 results on ${{ matrix.isam }}
145+
path: |
146+
_build/tests/cobol85/summary.*
147+
_build/tests/cobol85/**/*.log
148+
_build/tests/cobol85/**/*.out
149+
_build/tests/cobol85/**/duration.txt

0 commit comments

Comments
 (0)