-
Notifications
You must be signed in to change notification settings - Fork 2
218 lines (207 loc) · 7.24 KB
/
ci.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
# Github Actions configuration
name: CI
permissions: {}
on:
# Trigger the workflow on push or pull requests, but only for the
# master and ci branches
push:
branches:
- master
- ci
pull_request:
branches:
- master
env:
MAKEFLAGS: -j 2
jobs:
build-22_04:
name: 'Ubuntu 22.04 native and cross-compiled builds'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: 'Install deps'
run: >
sudo apt-get update -y &&
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends
make
clang
gcc-10-i686-linux-gnu
libc6-dev-i386-cross
gcc-mingw-w64
wine
dos2unix
qemu-user
gcc-10-aarch64-linux-gnu
libc6-dev-arm64-cross
gcc-10-arm-linux-gnueabi
libc6-dev-armel-cross
gcc-10-powerpc-linux-gnu
libc6-dev-powerpc-cross
gcc-10-powerpc64-linux-gnu
libc6-dev-ppc64-cross
- name: 'Compile with gcc'
run: make linux
- name: 'Run tests with gcc'
run: make test
- name: 'Compile with clang'
run: make clean && make linux LINUX_CC=clang
- name: 'Run tests with clang'
run: make test
- name: 'Compile with gcc 32-bit'
run: make clean && make linux LINUX_CC=i686-linux-gnu-gcc-10 LINUX_CFLAGS='-m32 -O2 -DUNIX -Wall -Wshadow -Wpedantic -Wcast-qual -Wcast-align -Wwrite-strings -Wno-attributes' LDFLAGS=-static
- name: 'Run tests with gcc 32-bit'
run: make test
- name: 'Compile with gcc-aarch64'
run: make clean && make linux LINUX_CC=aarch64-linux-gnu-gcc-10 LDFLAGS=-static
- name: 'Run tests with gcc-aarch64'
run: make test TESTWRAPPER=qemu-aarch64
- name: 'Compile with gcc-arm'
run: make clean && make linux LINUX_CC=arm-linux-gnueabi-gcc-10 LDFLAGS=-static
- name: 'Run tests with gcc-arm'
run: make test TESTWRAPPER=qemu-arm
- name: 'Compile with gcc-powerpc'
run: make clean && make linux LINUX_CC=powerpc-linux-gnu-gcc-10 LDFLAGS=-static
- name: 'Run tests with gcc-powerpc'
run: make test TESTWRAPPER=qemu-ppc
- name: 'Compile with gcc-powerpc64'
run: make clean && make linux LINUX_CC=powerpc64-linux-gnu-gcc-10 LDFLAGS=-static
- name: 'Run tests with gcc-powerpc64'
run: make test TESTWRAPPER=qemu-ppc64
- name: 'Set up wine'
run: |
cat >wine-wrapper <<EOF
#!/bin/bash
set -o pipefail
# Show all errors except for the ones about querying the display
WINEDEBUG=-all,err+all,-explorer,-rpc wine "\$@" |& dos2unix
EOF
chmod 755 wine-wrapper
# Run wine once to set it up, which displays some logs that would mess up tests
WINEDEBUG=-all wine cmd /c exit
- name: 'Compile with mingw32-posix'
run: make clean && make linux LINUX_CC=x86_64-w64-mingw32-gcc-10-posix
- name: 'Run tests with mingw32-posix+wine'
run: make test TESTWRAPPER=./wine-wrapper
- name: 'Compile with mingw32'
run: make clean && make linux LINUX_CC=x86_64-w64-mingw32-gcc
- name: 'Run tests with mingw32+wine'
run: make test TESTWRAPPER=./wine-wrapper
- name: 'Strip binary'
run: x86_64-w64-mingw32-strip fvcbm.exe
- uses: actions/upload-artifact@v4
with:
name: 'fvcbm-windows.exe'
path: fvcbm.exe
alpine-3_19:
name: 'Alpine 3.19 with MUSL'
runs-on: ubuntu-latest
container: 'alpine:3.19'
steps:
- uses: actions/checkout@v4
- name: 'Install deps'
run: >
cat /etc/os-release &&
apk add --no-cache
build-base
groff
- name: 'Compile with gcc with MUSL'
run: make linux
- name: 'Run tests with gcc with MUSL'
run: make test
- name: 'Install i386 chroot'
run: |
OSVER="$(sed -nE '/^VERSION_ID=/s/^.*=([0-9]+\.[0-9]+).*$/\1/p' /etc/os-release)"
apk -p i386root -X https://dl-cdn.alpinelinux.org/alpine/v${OSVER}/main -U --allow-untrusted --initdb --arch x86 add alpine-baselayout build-base groff
make clean
cp -a . i386root/root/fvcbm/ || true Ignore recursive copy error
- name: 'Compile with gcc with MUSL on i386'
run: chroot i386root make -C /root/fvcbm linux LINUX_CC=gcc CFLAGS='-static -m32 -O2'
- name: 'Run tests with gcc with MUSL on i386'
run: chroot i386root make -C /root/fvcbm test
- name: 'Strip binary'
run: strip i386root/root/fvcbm/fvcbm
- uses: actions/upload-artifact@v4
with:
name: 'fvcbm-linux-x86'
path: i386root/root/fvcbm/fvcbm
osx-12-x86_64:
name: 'macOS 12 on x86_64'
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: 'Compile with gcc on x86_64'
run: make linux
- name: 'Run tests with gcc on x86_64'
run: make test
- name: 'Compile fat binary with gcc on x86_64'
run: make clean && make linux LINUX_CC=cc LINUX_CFLAGS='-O2 -DUNIX -arch arm64 -arch x86_64'
- name: 'Run tests with fat binary with gcc on x86_64'
run: make test
- name: 'Strip binary'
run: strip fvcbm
- uses: actions/upload-artifact@v4
with:
name: 'fvcbm-macos'
path: fvcbm
osx-14-aarch64:
name: 'macOS 14 on aarch64'
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: 'Compile with gcc on aarch64'
# nroff is not available, so skip the man build
run: touch fvcbm.man && make linux
- name: 'Run tests with gcc on aarch64'
run: make test
- name: 'Compile fat binary with gcc on aarch64'
# nroff is not available, so skip the man build
run: make clean && touch fvcbm.man && make linux LINUX_CC=cc LINUX_CFLAGS='-O2 -DUNIX -arch arm64 -arch x86_64'
- name: 'Run tests with fat binary with gcc on aarch64'
run: make test
freebsd-13:
name: 'FreeBSD 13.2 on x86_64'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'build & test on FreeBSD'
uses: cross-platform-actions/[email protected]
with:
operating_system: "freebsd"
version: "13.2"
architecture: "x86_64"
run: |
# heirloom-tools has the original nroff, but it isn't working with -man
sudo pkg update -f && sudo pkg install -y groff
make linux LINUX_CC=cc
make test
freebsd-14:
name: 'FreeBSD 14.0 on x86_64'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'build & test on FreeBSD'
uses: cross-platform-actions/[email protected]
with:
operating_system: "freebsd"
version: "14.0"
architecture: "x86_64"
run: |
# heirloom-tools has the original nroff, but it isn't working with -man
sudo pkg update -f && sudo pkg install -y groff
make linux LINUX_CC=cc
make test
z88dk:
name: 'z88dk SDK'
runs-on: ubuntu-latest
container: 'z88dk/z88dk:latest'
steps:
- uses: actions/checkout@v4
- name: 'Show version'
run: zcc 2>&1 | head -1
- name: 'Compile with z88dk for CP/M'
# nroff is not available, so skip the man build
run: touch fvcbm.man && make cpm
- uses: actions/upload-artifact@v4
with:
name: 'fvcbm.com'
path: fvcbm