forked from OCamlPro/gnucobol
-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (176 loc) · 7.16 KB
/
windows-msys2.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
name: Windows MSYS2 Workflow
on:
pull_request:
branches: [ gc4 ]
push:
# manual run in actions tab - for all branches
workflow_dispatch:
jobs:
prepare:
runs-on: windows-latest
timeout-minutes: 10
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
# remove texinfo-tex & mingw-w64-x86_64-texlive-core ?
- name: Install packages
uses: msys2/setup-msys2@v2
with:
update: true
msystem: mingw64
install: autoconf automake make flex bison libtool help2man texinfo texinfo-tex
mingw-w64-x86_64-cc
mingw-w64-x86_64-gmp mingw-w64-x86_64-texlive-core
mingw-w64-x86_64-gettext-runtime gettext-devel
- name: Bootstrap GnuCOBOL
shell: msys2 {0}
run: |
./build_aux/bootstrap install
- name: Configure GnuCOBOL
shell: msys2 {0}
run: |
mkdir _build
cd _build
../configure --without-db --without-curses --without-xml2 --without-json
- name: Build GnuCOBOL source distribution
shell: msys2 {0}
run: |
make -C _build --jobs=$(($(nproc)+1))
make -C _build --jobs=$(($(nproc)+1)) dist
- name: Upload config-dist.log
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }} #-> always upload as build result documentation
with:
name: config-dist.log
path: _build/config.log
- name: Upload dist tarball
uses: actions/upload-artifact@v4
with:
name: gnucobol-ci source distribution msys2
path: _build/gnucobol*.tar.gz
if-no-files-found: error
retention-days: 1
build:
strategy:
fail-fast: false
matrix:
include:
- { target: release, sys: mingw64, env: x86_64 }
- { target: debug, sys: mingw64, env: x86_64 }
- { target: release, sys: ucrt64, env: ucrt-x86_64 }
- { target: release, sys: clang64, env: clang-x86_64 }
- { target: release, sys: mingw32, env: i686 }
runs-on: windows-latest
needs: prepare
timeout-minutes: ${{ matrix.sys == 'clang64' && 35 || 20 }}
steps:
- name: Get CI dist tarball
uses: actions/download-artifact@v4
with:
name: gnucobol-ci source distribution msys2
- name: Extract CI dist tarball
shell: msys2 {0}
run: |
tar -xvf gnucobol*.tar.* --strip-components=1
- name: Setup build environment
run: |
If ("${{ matrix.target }}" -eq "release") {
echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV
echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS2" >> $env:GITHUB_ENV
} Else {
echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV
echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS2-Debug --enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV
}
# Common options (dependencies)
echo CFGOPT="$env:CFGOPT --with-math=gmp --with-curses=ncursesw --with-xml2 --with-json=json-c" >> $env:GITHUB_ENV
# Conditional inclusion of --with-db (MSYS2 does not provide 32bit builds for BDB any more)
If ("${{ matrix.sys }}" -ne "mingw32") {
echo CFGOPT="$env:CFGOPT --with-db" >> $env:GITHUB_ENV
} Else {
echo CFGOPT="$env:CFGOPT --without-db" >> $env:GITHUB_ENV
}
- name: Install packages
uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{ matrix.sys }}
install: autoconf automake make flex bison diffutils libtool help2man texinfo
mingw-w64-${{ matrix.env }}-cc
mingw-w64-${{ matrix.env }}-gmp gmp-devel
mingw-w64-${{ matrix.env }}-gettext-runtime gettext-devel
mingw-w64-${{ matrix.env }}-ncurses
mingw-w64-${{ matrix.env }}-libxml2
mingw-w64-${{ matrix.env }}-json-c
- name: Install BDB package
if: ${{ matrix.sys != 'mingw32' }} # MSYS2 does not provide 32bit builds for it any more
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
install: mingw-w64-${{ matrix.env }}-db libdb-devel
- name: Configure GnuCOBOL
shell: msys2 {0}
run: |
mkdir _build
cd _build
../configure $CFGOPT
- name: Build GnuCOBOL
shell: msys2 {0}
run: |
make -C _build --jobs=$(($(nproc)+1))
- name: Upload config-${{ matrix.sys }}-${{ matrix.target }}.log
if: ${{ !cancelled() }} #-> always upload as build result documentation
uses: actions/upload-artifact@v4
with:
name: config-${{ matrix.sys }}-${{ matrix.target }}.log
path: _build/config.log
- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val
key: newcob-val
enableCrossOsArchive: true
- name: Run NIST85 testsuite
continue-on-error: true
shell: msys2 {0}
run: |
make -C _build/tests test --jobs=$(($(nproc)+1))
- name: Upload NIST85 Test Suite results
if: ${{ !cancelled() }} #-> always upload as build result documentation
uses: actions/upload-artifact@v4
with:
name: NIST85 results on ${{ matrix.sys }}-${{ matrix.target }}
path: |
_build/tests/cobol85/summary.*
_build/tests/cobol85/**/*.log
_build/tests/cobol85/**/*.out
_build/tests/cobol85/**/duration.txt
- name: Run testsuite
continue-on-error: true
shell: msys2 {0}
run: |
sed '/AT_SETUP(\[temporary path invalid\])/a \
AT_SKIP_IF(\[true\])' -i tests/testsuite.src/used_binaries.at
sed '/AT_SETUP(\[ACCEPT OMITTED (SCREEN)\])/a \
AT_SKIP_IF(\[true\])' -i tests/testsuite.src/run_accept.at
make -C _build/tests check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
make -C _build/tests check TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite-${{ matrix.sys }}-${{ matrix.target }}.log
if: ${{ !cancelled() }} #-> always upload as build result documentation
uses: actions/upload-artifact@v4
with:
name: testsuite-${{ matrix.sys }}-${{ matrix.target }}.log
path: _build/tests/testsuite.log
- name: Package GnuCOBOL MinGW nightly
shell: msys2 {0}
run: |
make -C _build distmingw
tar -cvf GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar _build/$DISTDIR
- name: Upload GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar
uses: actions/upload-artifact@v4
with:
name: GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar
path: GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar