-
Notifications
You must be signed in to change notification settings - Fork 1.2k
309 lines (293 loc) · 10.4 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
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
# vim: sw=2
name: Build CI
on:
push:
pull_request:
release:
types: [published]
check_suite:
types: [rerequested]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
rip-and-test:
runs-on: ubuntu-24.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/*
- name: Cache APT packages
uses: actions/cache@v3
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-apt-cache-
- name: Build RIP & test
run: |
set -x
sudo apt-get install -y eatmydata
eatmydata ./scripts/travis-install-build-deps.sh
sudo eatmydata apt --quiet --yes upgrade
cd src
eatmydata ./autogen.sh
eatmydata ./configure --disable-check-runtime-deps
eatmydata make -O -j$((1+$(nproc))) default pycheck V=1
# Note that the package build covers html docs
eatmydata ../scripts/rip-environment runtests -p
rip-and-test-clang:
runs-on: ubuntu-24.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/*
- name: Cache APT packages
uses: actions/cache@v3
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-apt-cache-
- name: Clang build RIP & test
run: |
set -x
sudo apt-get install -y eatmydata
eatmydata ./scripts/travis-install-build-deps.sh
sudo eatmydata apt-get install -y clang
sudo eatmydata apt --quiet --yes upgrade
cd src
eatmydata ./autogen.sh
CC=clang CXX=clang++ eatmydata ./configure --disable-check-runtime-deps
eatmydata make -O -j$((1+$(nproc))) default pycheck V=1
# Note that the package build covers html docs
eatmydata ../scripts/rip-environment runtests -p
htmldocs:
runs-on: ubuntu-24.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- run: git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc +refs/tags/*:refs/tags/*
- name: Cache APT packages
uses: actions/cache@v3
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-apt-cache-
- name: Build HTML docmentation
run: |
./scripts/travis-install-build-deps.sh
sudo apt-get install -y eatmydata
sudo eatmydata apt --quiet --yes upgrade
cd src
eatmydata ./autogen.sh
eatmydata ./configure --disable-check-runtime-deps --enable-build-documentation=html
eatmydata make -O -j$((1+$(nproc))) manpages
eatmydata make -O -j$((1+$(nproc))) translateddocs
eatmydata make -O -j$((1+$(nproc))) docs
# Note that the package build covers html docs
package-arch:
runs-on: ubuntu-24.04
strategy:
matrix:
image: ["debian:bullseye", "debian:bookworm", "debian:sid"]
container:
image: ${{ matrix.image }}
# IPC_OWNER is needed for shmget IPC_CREAT
# SYS_ADMIN is needed for shmctl IPC_SET
options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Cache APT packages
uses: actions/cache@v3
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-apt-cache-
- name: Install pre-dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
apt-get --quiet update
apt-get --yes --quiet install eatmydata curl
eatmydata apt --quiet --yes upgrade
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
- uses: actions/checkout@v3
with:
# "fetch-depth: 0" fetches all of history, this is needed by
# our build system to determine the version from tags
fetch-depth: 0
- name: Add linuxcnc.org deb archive
env:
DEBIAN_FRONTEND: noninteractive
run: |
case "${{matrix.image}}" in
debian:sid|debian:bookworm)
exit 0
;;
*)
;;
esac
set -e
set -x
eatmydata apt-get --yes --quiet install --no-install-recommends gpg software-properties-common
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
eatmydata apt-get --quiet update
- name: Build architecture-specific Debian packages
env:
DEBEMAIL: [email protected]
DEBFULLNAME: LinuxCNC Github CI Robot
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
eatmydata git config --global --add safe.directory "${PWD}"
eatmydata debian/configure
eatmydata debian/update-dch-from-git
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
eatmydata git diff
eatmydata apt-get --yes --quiet build-dep --arch-only .
eatmydata debuild -us -uc --build=any
- name: Test debian packages
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
eatmydata apt-get --yes --quiet install ../*.deb
eatmydata apt-get --yes --quiet install sudo # some tests run sudo...
eatmydata adduser --disabled-password --gecos "" testrunner
eatmydata passwd -d testrunner
eatmydata adduser testrunner sudo
chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner
su -c "eatmydata ./scripts/runtests -p ./tests" testrunner
package-indep:
runs-on: ubuntu-24.04
strategy:
matrix:
image: ["debian:bullseye", "debian:bookworm", "debian:sid"]
container:
image: ${{ matrix.image }}
# IPC_OWNER is needed for shmget IPC_CREAT
# SYS_ADMIN is needed for shmctl IPC_SET
options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Cache APT packages
uses: actions/cache@v3
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-apt-cache-
- name: Install pre-dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
apt-get --quiet update
apt-get --yes --quiet install eatmydata curl
eatmydata apt --quiet --yes upgrade
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
- uses: actions/checkout@v3
with:
# "fetch-depth: 0" fetches all of history, this is needed by
# our build system to determine the version from tags
fetch-depth: 0
- name: Add linuxcnc.org deb archive
env:
DEBIAN_FRONTEND: noninteractive
run: |
case "${{matrix.image}}" in
debian:sid|debian:bookworm)
exit 0
;;
*)
;;
esac
set -e
set -x
eatmydata apt-get --yes --quiet install gpg software-properties-common
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
eatmydata apt-get --quiet update
- name: Build architecture-independent Debian packages
env:
DEBEMAIL: [email protected]
DEBFULLNAME: LinuxCNC Github CI Robot
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
eatmydata git config --global --add safe.directory "${PWD}"
eatmydata debian/configure
eatmydata debian/update-dch-from-git
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
eatmydata git diff
eatmydata apt-get --yes --quiet build-dep --indep-only .
eatmydata debuild -us -uc --build=all
- name: Test install debian packages
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
eatmydata apt-get --yes --quiet install ../*.deb
cppcheck:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Cache APT packages
uses: actions/cache@v3
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-apt-cache-
- name: Perform Source Code checks that were successful in the past
continue-on-error: true
run: |
set -x
git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/*
sudo apt-get -y install cppcheck shellcheck
scripts/cppcheck.sh
- name: Shellcheck
continue-on-error: true
run: |
scripts/shellcheck.sh