generated from gnu-ci-templates/ci-check
-
Notifications
You must be signed in to change notification settings - Fork 0
238 lines (232 loc) · 9.82 KB
/
bsd.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
# 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 "[bsd]" at the start of the head
# commit message that is pushed. For example:
# git commit -m "[bsd] 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 "[bsd] [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: BSD make check
on:
push:
# Variables.
env:
package: libtool
branch: development
jobs:
build-tarball:
if: ${{ startsWith(github.event.head_commit.message, '[bsd]') }}
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-freebsd:
name: make check on FreeBSD
needs: build-tarball
# The FreeBSD runners sometimes get stuck.
timeout-minutes: 15
runs-on: ubuntu-22.04
steps:
# This is needed because we run a script stored in this repository.
- 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/vmactions/freebsd-vm
- uses: vmactions/freebsd-vm@v1
with:
release: '14.0'
mem: 1024
usesh: true
run: |
set -x
uname -a
id
env | LC_ALL=C sort
pwd
: "Install FreeBSD packages"
: "List of packages: https://ports.freebsd.org/cgi/ports.cgi"
pkg install -y m4 automake gcc
ls -l
export CPPFLAGS="-I/usr/local/include -Wall"
export LDFLAGS="-L/usr/local/lib"
./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-freebsd
path: ${{ env.package }}-build.tar.gz
if-no-files-found: error
retention-days: 3
compression-level: 0
overwrite: true
check-netbsd:
name: make check on NetBSD
needs: build-tarball
runs-on: ubuntu-22.04
steps:
# This is needed because we run a script stored in this repository.
- 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/vmactions/netbsd-vm
- uses: vmactions/netbsd-vm@v1
with:
release: '10.0'
mem: 1024
usesh: true
run: |
set -x
uname -a
id
env | LC_ALL=C sort
pwd
: "Install NetBSD packages"
: "List of packages: https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/index-all.html"
: "The only Fortran compiler available here is flang, not easy to use."
/usr/sbin/pkg_add m4 automake autoconf
ls -l
export CPPFLAGS="-I/usr/pkg/include -Wall"
export LDFLAGS="-L/usr/pkg/lib"
./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-netbsd
path: ${{ env.package }}-build.tar.gz
if-no-files-found: error
retention-days: 3
compression-level: 0
overwrite: true
check-openbsd:
name: make check on OpenBSD
needs: build-tarball
runs-on: ubuntu-22.04
steps:
# This is needed because we run a script stored in this repository.
- 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/vmactions/openbsd-vm
- uses: vmactions/openbsd-vm@v1
with:
release: '7.5'
mem: 1024
usesh: true
# Avoid 'sync: sshfs' since it causes trouble with file timestamps
# and errors from chown() calls:
# - BSD tar error messages for r--r--r-- files: "tar: Unable to create ...: Permission denied"
# - GNU tar warnings "Cannot change ownership to uid 0, gid 0: Permission denied"
#sync: sshfs
run: |
set -x
uname -a
id
env | LC_ALL=C sort
pwd
: "Install OpenBSD packages"
: "List of packages: https://cdn.openbsd.org/pub/OpenBSD/7.5/packages/amd64/"
pkg_add m4 automake-1.16.5 autoconf-2.71 gmake gcc-11.2.0p11 g++-11.2.0p12
ls -l /usr/bin/acl* /usr/bin/auto* /usr/local/bin/acl* /usr/local/bin/auto*
export PATH=/usr/local/bin:$PATH
: "The OpenBSD port of autoconf needs this. See <https://marc.info/?l=openbsd-misc&m=115868167816272&w=2>."
export AUTOCONF_VERSION=2.71
: "The OpenBSD port of automake needs this, if more than one version is installed."
export AUTOMAKE_VERSION=1.16
ls -l
export CPPFLAGS="-I/usr/local/include -Wall"
export LDFLAGS="-L/usr/local/lib"
./build-on.sh '${{ env.package }}' '' 'gmake' 'LIBTOOLFLAGS=--test' '${{ 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-openbsd
path: ${{ env.package }}-build.tar.gz
if-no-files-found: error
retention-days: 3
compression-level: 0
overwrite: true