-
Notifications
You must be signed in to change notification settings - Fork 1.2k
235 lines (221 loc) · 7.86 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
# vim: sw=2
name: Build CI
on:
push:
pull_request:
release:
types: [published]
check_suite:
types: [rerequested]
jobs:
rip-and-test:
runs-on: ubuntu-20.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: Build RIP & test
run: |
./scripts/travis-install-build-deps.sh
sudo apt-get install -y eatmydata
curl -O https://snapshot.debian.org/archive/debian/20220716T154603Z/pool/main/p/po4a/po4a_0.67-2_all.deb
sudo apt install ./po4a_0.67-2_all.deb
cd src
eatmydata ./autogen.sh
eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps
eatmydata make -O -j$((1+$(nproc))) default pycheck V=1
# Note that the package build covers html docs
../scripts/rip-environment runtests -p
htmldocs:
runs-on: ubuntu-20.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: Build HTML docmentation
run: |
./scripts/travis-install-build-deps.sh
sudo apt-get install -y eatmydata
curl -O https://snapshot.debian.org/archive/debian/20220716T154603Z/pool/main/p/po4a/po4a_0.67-2_all.deb
sudo apt install ./po4a_0.67-2_all.deb
cd src
eatmydata ./autogen.sh
eatmydata ./configure --with-realtime=uspace --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-latest
strategy:
matrix:
image: ["debian:buster", "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: Install pre-dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
apt-get --quiet update
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
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: |
set -e
set -x
apt-get --yes --quiet install --no-install-recommends gpg software-properties-common
gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
add-apt-repository "deb http://linuxcnc.org $DIST base"
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
git config --global --add safe.directory "${PWD}"
debian/configure
debian/update-dch-from-git
scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
git diff
apt-get --yes --quiet build-dep --arch-only .
apt-get --yes --quiet install eatmydata
eatmydata debuild -us -uc --build=any
- name: Test debian packages
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
apt-get --yes --quiet install ../*.deb
apt-get --yes --quiet install sudo # some tests run sudo...
adduser --disabled-password --gecos "" testrunner
passwd -d testrunner
adduser testrunner sudo
chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner
su -c "./scripts/runtests -p ./tests" testrunner
- name: Stage debs for archiving
run: |
set -e
set -x
mkdir -p built-debs/$(lsb_release -cs)
cp ../linuxcnc*_* built-debs/$(lsb_release -cs)
- name: Archive generated Debian packages
uses: actions/upload-artifact@v3
with:
name: debs
retention-days: 7
path: built-debs/*
package-indep:
runs-on: ubuntu-latest
strategy:
matrix:
image: ["debian:buster", "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: Install pre-dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
apt-get --quiet update
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
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: |
set -e
set -x
apt-get --yes --quiet install gpg software-properties-common
gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
add-apt-repository "deb http://linuxcnc.org $DIST base"
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
git config --global --add safe.directory "${PWD}"
debian/configure
debian/update-dch-from-git
scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
git diff
apt-get --yes --quiet build-dep --indep-only .
apt-get --yes --quiet install eatmydata
eatmydata debuild -us -uc --build=all
- name: Test install debian packages
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -e
set -x
apt-get --yes --quiet install ../*.deb
- name: Stage debs for archiving
run: |
set -e
set -x
mkdir -p built-debs/$(lsb_release -cs)
cp ../linuxcnc*_* built-debs/$(lsb_release -cs)
- name: Archive generated PDF files
uses: actions/upload-artifact@v3
with:
name: PDFs
retention-days: 7
path: docs/*.pdf
- name: Archive generated Debian packages
uses: actions/upload-artifact@v3
with:
name: debs
retention-days: 7
path: built-debs/*