Skip to content

Commit 9c3736f

Browse files
ci: add platform build coverage
1 parent 88692b7 commit 9c3736f

2 files changed

Lines changed: 176 additions & 3 deletions

File tree

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: platform builds
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
linux-compat:
17+
name: ${{ matrix.name }}
18+
runs-on: ${{ matrix.runner }}
19+
timeout-minutes: 15
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- name: ubuntu-22.04
25+
runner: ubuntu-22.04
26+
run_tests: true
27+
- name: ubuntu-24.04-arm
28+
runner: ubuntu-24.04-arm
29+
run_tests: true
30+
- name: ubuntu-24.04-release
31+
runner: ubuntu-24.04
32+
buildtype: release
33+
- name: ubuntu-24.04-debug
34+
runner: ubuntu-24.04
35+
buildtype: debug
36+
- name: ubuntu-24.04-hardened
37+
runner: ubuntu-24.04
38+
extra_cflags: "-D_FORTIFY_SOURCE=3 -fstack-protector-strong"
39+
steps:
40+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
41+
42+
- name: Set up Python
43+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
44+
with:
45+
python-version: '3.12'
46+
47+
- name: Install dependencies
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y gcc ninja-build pkg-config libglib2.0-dev libfuse3-dev ${{ matrix.run_tests && 'openssh-server openssh-client fuse3' || '' }}
51+
pip3 install meson ${{ matrix.run_tests && 'pytest pytest-timeout' || '' }}
52+
53+
- name: Build
54+
env:
55+
CFLAGS: ${{ matrix.extra_cflags || '' }}
56+
run: |
57+
meson setup build ${{ matrix.buildtype && format('--buildtype={0}', matrix.buildtype) || '' }}
58+
ninja -C build
59+
60+
- name: Setup SSH
61+
if: matrix.run_tests
62+
run: |
63+
chmod go-w ~
64+
mkdir -p ~/.ssh
65+
chmod 700 ~/.ssh
66+
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
67+
cat ~/.ssh/id_ed25519.pub > ~/.ssh/authorized_keys
68+
chmod 600 ~/.ssh/authorized_keys
69+
sudo sed -i 's/^#*PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
70+
sudo systemctl restart ssh || sudo service ssh restart
71+
ssh -o StrictHostKeyChecking=no -o BatchMode=yes localhost true
72+
73+
- name: Check FUSE availability
74+
if: matrix.run_tests
75+
run: |
76+
test -e /dev/fuse
77+
command -v fusermount3
78+
79+
- name: Run tests
80+
if: matrix.run_tests
81+
timeout-minutes: 20
82+
run: |
83+
cd build
84+
python3 -m pytest test/ --timeout=300 --maxfail=99 --junitxml=test-results.xml
85+
86+
- name: Upload test results
87+
if: matrix.run_tests && always()
88+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
89+
with:
90+
name: test-results-${{ matrix.name }}
91+
path: |
92+
build/test-results.xml
93+
build/meson-logs/
94+
95+
- name: Upload build logs
96+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
97+
if: failure()
98+
with:
99+
name: build-logs-${{ matrix.name }}
100+
path: build/meson-logs/
101+
102+
alpine-musl:
103+
name: alpine-musl
104+
runs-on: ubuntu-24.04
105+
timeout-minutes: 15
106+
steps:
107+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
108+
109+
- name: Build in Alpine container
110+
run: |
111+
docker run --rm -v "$PWD:/work" -w /work alpine:3.21@sha256:48b0309ca019d89d40f670aa1bc06e426dc0931948452e8491e3d65087abc07d sh -euxc '
112+
apk add --no-cache gcc musl-dev meson ninja pkgconf glib-dev fuse3-dev
113+
meson setup build-alpine
114+
ninja -C build-alpine
115+
'
116+
117+
- name: Upload build logs
118+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
119+
if: failure()
120+
with:
121+
name: build-logs-alpine-musl
122+
path: build-alpine/meson-logs/
123+
124+
freebsd:
125+
name: freebsd-14
126+
runs-on: ubuntu-24.04
127+
timeout-minutes: 20
128+
steps:
129+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
130+
131+
- name: Build on FreeBSD
132+
uses: vmactions/freebsd-vm@d1e65811565151536c0c894fff74f06351ed26e6 # v1.4.5
133+
with:
134+
usesh: true
135+
prepare: |
136+
pkg install -y fusefs-libs3 glib meson ninja pkgconf
137+
run: |
138+
meson setup build-freebsd
139+
ninja -C build-freebsd
140+
141+
- name: Upload build logs
142+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
143+
if: failure()
144+
with:
145+
name: build-logs-freebsd
146+
path: build-freebsd/meson-logs/
147+
148+
macos:
149+
name: macOS
150+
runs-on: macos-14
151+
timeout-minutes: 20
152+
continue-on-error: true
153+
steps:
154+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
155+
156+
- name: Install dependencies
157+
run: |
158+
brew install --cask macfuse
159+
brew install glib meson ninja pkg-config
160+
161+
- name: Build
162+
env:
163+
PKG_CONFIG_PATH: "/usr/local/lib/pkgconfig:/opt/homebrew/lib/pkgconfig"
164+
run: |
165+
meson setup build
166+
ninja -C build
167+
168+
- name: Upload build logs
169+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
170+
if: failure()
171+
with:
172+
name: build-logs-macos
173+
path: build/meson-logs/

.github/workflows/build-ubuntu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install build dependencies
3535
run: |
3636
sudo apt-get update
37-
sudo apt-get install -y valgrind gcc ninja-build libglib2.0-dev libfuse3-dev openssh-server openssh-client fuse3
37+
sudo apt-get install -y valgrind gcc ninja-build libglib2.0-dev libfuse3-dev openssh-server openssh-client fuse3 rsync
3838
3939
- name: Check FUSE availability
4040
run: |
@@ -61,8 +61,8 @@ jobs:
6161
run: |
6262
mkdir -p ~/.ssh
6363
chmod 700 ~/.ssh
64-
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""
65-
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
64+
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
65+
cat ~/.ssh/id_ed25519.pub > ~/.ssh/authorized_keys
6666
chmod 600 ~/.ssh/authorized_keys
6767
sudo systemctl start ssh || sudo service ssh start
6868
ssh -o StrictHostKeyChecking=no -o BatchMode=yes localhost true

0 commit comments

Comments
 (0)