generated from gnu-ci-templates/ci-check
-
Notifications
You must be signed in to change notification settings - Fork 0
325 lines (319 loc) · 13.4 KB
/
windows.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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# A GitHub Actions workflow that builds a package on many platforms.
# Copyright (C) 2024 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Reference documentation for this file:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
# Syntax of multiline strings in YAML: https://yaml-multiline.info/
#
# To execute this workflow, specify "[windows]" at the start of the head
# commit message that is pushed. For example:
# git commit -m "[windows] Test patch"
#
# Customization:
# - Review and adapt the part of this file before the 'jobs:' line.
# - You can disable a particular job by adding a line
# if: ${{ false }}
# - You can disable a particular matrix value for a particular job by adding an
# 'exclude' element to the 'matrix' element, such as:
# exclude:
# - bitness: 64
# - You can execute pre-release testing by specifying "[pre-release]" anywhere
# in the head commit message that is pushed. For example:
# git commit -m "[windows] [pre-release] Test patch"
# - NOTE: By default, all OS-specific logs are not uploaded for download
# when executing pre-release testing. To enable, update the following:
# if: ${{ always() && !contains(github.event.head_commit.message, '[pre-release]') }}
# To this:
# if: ${{ always() }}
name: Cygwin, mingw, and MSVC make check
on:
push:
# Variables.
env:
package: libtool
branch: development
jobs:
build-tarball:
if: ${{ startsWith(github.event.head_commit.message, '[windows]') }}
runs-on: ubuntu-22.04
steps:
# This is needed because we run a script stored in this repository.
- uses: actions/checkout@v4
- run: uname -a
- run: id
- run: env | LC_ALL=C sort
- run: pwd
# Install Ubuntu packages.
# List of packages: https://packages.ubuntu.com/
- run: sudo apt update; sudo apt install help2man texlive-base texlive-latex-base
- run: |
./build-dev-tarball.sh '${{ env.package }}' '${{ env.branch }}' '${{ github.event.head_commit.message }}'
# Doc: https://github.com/actions/upload-artifact?tab=readme-ov-file#usage
- if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: logs-build-tarball-failed
path: |
${{ env.package }}/config.cache
${{ env.package }}/config.log
${{ env.package }}/config.status
${{ env.package }}/log[1234]
${{ env.package }}/tests/testsuite.dir/*/testsuite.log
retention-days: 3
overwrite: true
# Doc: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
# https://github.com/actions/upload-artifact?tab=readme-ov-file#usage
- uses: actions/upload-artifact@v4
with:
name: tarball
path: ${{ env.package }}/${{ env.package }}-*.tar.gz
if-no-files-found: error
retention-days: 3
compression-level: 0
overwrite: true
check-cygwin:
name: make check on Cygwin
needs: build-tarball
if: ${{ false }}
# Doc: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
fail-fast: false
matrix:
bitness: [32, 64]
# On 32-bit Cygwin, the test "static linking flags for programs" would
# hang indefinitely.
exclude:
- bitness: 32
runs-on: windows-2022
defaults:
run:
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
env:
CYGWIN_NOWINPATH: 1
steps:
# This is needed because we run a script stored in this repository.
- run: git config --global core.autocrlf input
shell: cmd
- uses: actions/checkout@v4
# Download the artifact to $GITHUB_WORKSPACE.
# Doc: https://github.com/actions/download-artifact?tab=readme-ov-file#usage
- uses: actions/download-artifact@v4
with:
name: tarball
# Doc: https://github.com/cygwin/cygwin-install-action
- uses: cygwin/cygwin-install-action@v4
with:
platform: ${{ matrix.bitness == 32 && 'x86' || 'x86_64' }}
# Install Cygwin packages.
# List of packages: https://cygwin.com/packages/package_list.html
packages: m4 automake gcc-core gcc-g++ gcc-fortran make
- name: cygcheck
run: cygcheck -V
- name: cygcheck
run: cygcheck -s -r
- name: Windows version
run: cmd /c ver
- run: uname -a
- run: id
- run: env | LC_ALL=C sort
- run: pwd
- run: ls -l
- run: echo "$PATH"
- run: ls -l /usr/bin
- name: Build in Cygwin
run: |
export CPPFLAGS="-Wall"
./build-on.sh '${{ env.package }}' '' 'make' '' '${{ github.event.head_commit.message }}'
- if: ${{ always() && !contains(github.event.head_commit.message, '[pre-release]') }}
run: tar czf ${{ env.package }}-build.tar.gz ${{ env.package }}-*/
# Doc: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
# https://github.com/actions/upload-artifact?tab=readme-ov-file#usage
- if: ${{ always() && !contains(github.event.head_commit.message, '[pre-release]') }}
uses: actions/upload-artifact@v4
with:
name: logs-cygwin${{ matrix.bitness }}
path: ${{ env.package }}-build.tar.gz
if-no-files-found: error
retention-days: 3
compression-level: 0
overwrite: true
check-mingw:
name: make check on mingw
needs: build-tarball
if: ${{ false }}
# Doc: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
fail-fast: false
matrix:
bitness: [32, 64]
runs-on: windows-2022
defaults:
run:
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
env:
CYGWIN_NOWINPATH: 1
steps:
# This is needed because we run a script stored in this repository.
- run: git config --global core.autocrlf input
shell: cmd
- uses: actions/checkout@v4
# Download the artifact to $GITHUB_WORKSPACE.
# Doc: https://github.com/actions/download-artifact?tab=readme-ov-file#usage
- uses: actions/download-artifact@v4
with:
name: tarball
# Doc: https://github.com/cygwin/cygwin-install-action
- uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
# Install Cygwin packages.
# List of packages: https://cygwin.com/packages/package_list.html
packages: m4 automake ${{ matrix.bitness == 32 && 'mingw64-i686-gcc-core mingw64-i686-gcc-g++ mingw64-i686-gcc-fortran mingw64-i686-headers mingw64-i686-runtime' || 'mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ mingw64-x86_64-gcc-fortran mingw64-x86_64-headers mingw64-x86_64-runtime' }} make
- name: cygcheck
run: cygcheck -V
- name: cygcheck
run: cygcheck -s -r
- name: Windows version
run: cmd /c ver
- run: uname -a
- run: id
- run: env | LC_ALL=C sort
- run: pwd
- run: ls -l
- run: echo "$PATH"
- run: ls -l /usr/bin
- name: Build in Cygwin
run: |
set -x
PATH=/usr/${{ matrix.bitness == 32 && 'i686' || 'x86_64' }}-w64-mingw32/sys-root/mingw/bin:$PATH
export CPPFLAGS="-Wall"
export CC=${{ matrix.bitness == 32 && 'i686' || 'x86_64' }}-w64-mingw32-gcc
./build-on.sh '${{ env.package }}' '--host=${{ matrix.bitness == 32 && 'i686' || 'x86_64' }}-w64-mingw32' 'make' '' '${{ github.event.head_commit.message }}'
- if: ${{ always() && !contains(github.event.head_commit.message, '[pre-release]') }}
run: tar czf ${{ env.package }}-build.tar.gz ${{ env.package }}-*/
# Doc: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
# https://github.com/actions/upload-artifact?tab=readme-ov-file#usage
- if: ${{ always() && !contains(github.event.head_commit.message, '[pre-release]') }}
uses: actions/upload-artifact@v4
with:
name: logs-mingw${{ matrix.bitness }}
path: ${{ env.package }}-build.tar.gz
if-no-files-found: error
retention-days: 3
compression-level: 0
overwrite: true
check-msvc:
name: make check on MSVC
needs: build-tarball
timeout-minutes: 180
# These test runs show more than 50 test failures.
# if: ${{ false }}
# Doc: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
fail-fast: false
matrix:
bitness: [32, 64]
runs-on: windows-2022
defaults:
run:
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
env:
CYGWIN_NOWINPATH: 1
steps:
# This is needed because we run a script stored in this repository.
- run: git config --global core.autocrlf input
shell: cmd
- uses: actions/checkout@v4
# Download the artifact to $GITHUB_WORKSPACE.
# Doc: https://github.com/actions/download-artifact?tab=readme-ov-file#usage
- uses: actions/download-artifact@v4
with:
name: tarball
# Doc: https://github.com/ilammy/msvc-dev-cmd
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.bitness == 32 && 'x86' || 'x64' }}
# Doc: https://github.com/cygwin/cygwin-install-action
- uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
# Install Cygwin packages.
# List of packages: https://cygwin.com/packages/package_list.html
packages: wget m4 automake make
- name: cygcheck
run: cygcheck -V
- name: cygcheck
run: cygcheck -s -r
- name: Windows version
run: cmd /c ver
- run: uname -a
- run: id
- run: env | LC_ALL=C sort
- run: pwd
- run: ls -l
- run: echo "$PATH"
- run: ls -l /usr/bin
- run: |
wget -O ar-lib 'https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD'
wget -O compile 'https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/compile;hb=HEAD'
chmod a+x ar-lib compile
- name: Build in Cygwin
env:
arch: ${{ matrix.bitness == 32 && 'x86' || 'x64' }}
pathelementsuffix: ${{ matrix.bitness == 64 && '/amd64' || '' }}
libelementsuffix: ${{ matrix.bitness == 64 && '\amd64' || '' }}
run: |
set -x
: "Windows C library headers and libraries."
WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt'
WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\'
INCLUDE="${WindowsCrtIncludeDir};$INCLUDE"
LIB="${WindowsCrtLibDir}${arch};$LIB"
: "Windows API headers and libraries."
WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\'
WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\'
INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE"
LIB="${WindowsSdkLibDir}${arch};$LIB"
: "Visual C++ tools, headers and libraries."
VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0'
VCINSTALLDIR="${VSINSTALLDIR}"'\VC'
PATH=`cygpath -u "${VCINSTALLDIR}"`/bin${pathelementsuffix}:"$PATH"
INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}"
LIB="${VCINSTALLDIR}"'\lib${libelementsuffix};'"${LIB}"
export INCLUDE LIB
: "Possible values are _WIN32_WINNT_WINXP, _WIN32_WINNT_VISTA, _WIN32_WINNT_WIN7"
win32_target=_WIN32_WINNT_WINXP
export CPPFLAGS="-D_WIN32_WINNT=$win32_target"
export CC="`pwd`/compile cl -nologo"; export CFLAGS="-MD"
export LD="link"
export NM="dumpbin -symbols"
export STRIP=":"
export AR="`pwd`/ar-lib lib"
export RANLIB=":"
./build-on.sh '${{ env.package }}' '--host=${{ matrix.bitness == 32 && 'i686' || 'x86_64' }}-w64-mingw32' 'make' '' '${{ github.event.head_commit.message }}'
- if: ${{ always() && !contains(github.event.head_commit.message, '[pre-release]') }}
run: tar czf ${{ env.package }}-build.tar.gz ${{ env.package }}-*/
# Doc: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
# https://github.com/actions/upload-artifact?tab=readme-ov-file#usage
- if: ${{ always() && !contains(github.event.head_commit.message, '[pre-release]') }}
uses: actions/upload-artifact@v4
with:
name: logs-msvc${{ matrix.bitness }}
path: ${{ env.package }}-build.tar.gz
if-no-files-found: error
retention-days: 3
compression-level: 0
overwrite: true