-
Notifications
You must be signed in to change notification settings - Fork 35
242 lines (212 loc) · 5.65 KB
/
c-cpp.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
name: C/C++ CI
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
push:
branches: master
paths:
- '**'
- '!**.yml'
- '!**/.github'
- '!**.md'
- '!docker/**'
- '!packaging/**'
- '!**.txt'
- '**/c-cpp.yml'
pull_request:
branches: master
paths:
- '**'
- '!**.yml'
- '!**/.github'
- '!**.md'
- '!docker/**'
- '!packaging/**'
- '!**.txt'
- '**/c-cpp.yml'
env:
TERM: xterm
jobs:
build:
name: ${{ matrix.name }}-${{ matrix.os }}-${{ matrix.cc }}
strategy:
fail-fast: false
matrix:
name: [default]
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
cc: [gcc, clang]
include:
- name: Slackware
os: ubuntu-latest
container: 'andy5995/slackware-build-essential:15.0'
- name: Alpine
os: ubuntu-latest
container: andy5995/rmw:build-env-alpine
setup_options: -Db_sanitize=none
- name: OpenSuse-Tumbleweed
os: ubuntu-latest
container: andy5995/rmw:build-env-tumbleweed
runs-on: ${{ matrix.os }}
needs:
- various
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Set CC
run: |
CC=${{ matrix.cc }}
if [ "$CC" = "gcc" ] || [ -z "$CC" ]; then
CC=gcc
CXX=g++
else
CC=clang
CXX=clang++
fi
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
- name: Show info
run: |
export -p
echo '${{ toJSON(matrix) }}'
- if: ${{ matrix.container == null }}
run: |
sudo apt update
sudo apt remove -y firefox
sudo apt upgrade -y
sudo apt-get install -y \
gettext \
python3-pip \
python3-setuptools
sudo -H python3 -m pip install meson ninja
- if: ${{ contains(matrix.container, 'alpine') }}
run: |
apk update
apk upgrade
- if: ${{ contains(matrix.container, 'tumbleweed') }}
run: |
zypper --non-interactive refresh
zypper --non-interactive update
- name: Configure
run: meson setup builddir $SETUP_OPTIONS ${{ matrix.setup_options }}
- name: Build
run: |
cd builddir
ninja -v
- name: Test
run: cd builddir && meson test -v
openbsd:
runs-on: ubuntu-latest
needs:
- build
name: OpenBSD
steps:
- uses: actions/checkout@v4
- name: Test in OpenBSD
id: test
uses: vmactions/openbsd-vm@v1
with:
usesh: true
prepare: |
pkg_add gettext git meson ninja
run: |
meson setup builddir -Db_sanitize=none $SETUP_OPTIONS || cat builddir/meson-logs/meson-log.txt
cd builddir
meson compile -v
meson test -v --suite rmw
macos:
name: macos-${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: brew-canfigger
install_packages: canfigger
setup_options: --wrap-mode nofallback
- name: bundled-canfigger
runs-on: macos-latest
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Show info
run: |
export -p
echo '${{ toJSON(matrix) }}'
- run: |
brew update
brew install \
gettext \
meson \
ninja \
ncurses \
pkg-config \
${{ matrix.build.install_packages }}
- name: Configure
run: meson setup builddir ${{ matrix.build.setup_options }}
- name: Build
run: |
cd builddir
ninja -v
- name: Test
run: cd builddir && meson test -v
various:
name: Test Various Build Configurations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache btrfs Image
uses: actions/cache@v4
id: btrfs-img-cache
with:
path: test/rmw-btrfs-test.img
key: ${{ hashFiles('test/rmw-btrfs-test.img.sha256sum') }}
- if: ${{ steps.btrfs-img-cache.outputs.cache-hit != 'true' }}
run: curl -L -o test/rmw-btrfs-test.img 'https://www.dropbox.com/scl/fi/57g3ixd3w3tuz4qoc2zp1/rmw-btrfs-test.img?rlkey=yc7krtntswsa1bwz0sbugy4gi&st=hkgrht05&dl=0'
- name: Test btrfs image existence
run: test -f test/rmw-btrfs-test.img
- name: Install Dependencies
run: |
sudo apt update
sudo apt remove -y firefox
sudo apt upgrade -y
sudo apt-get install -y \
faketime \
gettext \
meson \
ninja-build \
xvfb
- name: Configure with nls
run: meson setup builddir
- name: Build
run: meson compile -C builddir
- name: meson dist
run: cd builddir && meson dist --include-subprojects
- name: meson dist without gettext installed
run: |
sudo apt remove -y gettext
cd builddir
meson setup --wipe -Dnls=false
meson dist --include-subprojects
- name: Without curses or nls
run: |
cd builddir
meson configure -Dwithout-curses=true -Dnls=false
meson test -v
- name: Epochalypse test
run: |
rm -rf builddir
meson setup builddir -Db_sanitize=none
cd builddir
meson test -v --setup=epochalypse --suite=rmw
- name: with lto and FORTIFY
run: |
cd builddir
meson setup --wipe \
-Db_sanitize=none \
-Dc_args=-D_FORTIFY_SOURCE=3 \
-Dbuildtype=debugoptimized \
-Db_lto=true
meson test -v