Skip to content

Commit 314af79

Browse files
ci: add gcc/clang matrix with -Werror
- Expand build job into gcc/clang matrix with fail-fast: false - Pass -Dwerror=true so compiler warnings fail the build - Pin all actions to Node 24-capable full SHAs (checkout v6.0.2, setup-python v6.2.0, upload-artifact v7.0.1) - Add least-privilege permissions, concurrency cancellation - Pin python-version to 3.12, pin runner to ubuntu-24.04 - Add explicit SSH setup with sshd start, hard-fail FUSE preflight - Add pytest --timeout=300, --maxfail=99, JUnit XML, test result artifacts per compiler
1 parent 88692b7 commit 314af79

1 file changed

Lines changed: 31 additions & 21 deletions

File tree

.github/workflows/build-ubuntu.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ concurrency:
1919

2020
jobs:
2121
build-and-test:
22-
name: Build and test
22+
name: Build and test (${{ matrix.compiler }})
2323
runs-on: ubuntu-24.04
2424
timeout-minutes: 30
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- compiler: gcc
30+
cc: gcc
31+
- compiler: clang
32+
cc: clang
2533
steps:
2634
- name: Checkout code
2735
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -34,50 +42,52 @@ jobs:
3442
- name: Install build dependencies
3543
run: |
3644
sudo apt-get update
37-
sudo apt-get install -y valgrind gcc ninja-build libglib2.0-dev libfuse3-dev openssh-server openssh-client fuse3
45+
sudo apt-get install -y valgrind gcc clang ninja-build libglib2.0-dev libfuse3-dev openssh-server openssh-client fuse3
46+
47+
- name: Install meson
48+
run: pip3 install meson pytest pytest-timeout
49+
50+
- name: Setup SSH
51+
run: |
52+
mkdir -p ~/.ssh
53+
chmod 700 ~/.ssh
54+
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N ""
55+
cat ~/.ssh/id_ed25519.pub > ~/.ssh/authorized_keys
56+
chmod 600 ~/.ssh/authorized_keys
57+
sudo systemctl start ssh || sudo service ssh start
58+
ssh -o StrictHostKeyChecking=no -o BatchMode=yes localhost true
3859
3960
- name: Check FUSE availability
4061
run: |
4162
test -e /dev/fuse
4263
command -v fusermount3
4364
44-
- name: Install meson
45-
run: pip3 install meson pytest pytest-timeout
46-
4765
- name: build
66+
env:
67+
CC: ${{ matrix.cc }}
4868
run: |
49-
meson setup build
69+
meson setup build -Dwerror=true
5070
ninja -C build
5171
5272
# cd does not persist across steps
5373
- name: upload build artifact
5474
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
5575
with:
56-
name: sshfs
76+
name: sshfs-${{ matrix.compiler }}
5777
path: build/sshfs
5878
if-no-files-found: ignore
5979

60-
- name: Setup SSH
61-
run: |
62-
mkdir -p ~/.ssh
63-
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
66-
chmod 600 ~/.ssh/authorized_keys
67-
sudo systemctl start ssh || sudo service ssh start
68-
ssh -o StrictHostKeyChecking=no -o BatchMode=yes localhost true
69-
7080
- name: run tests
81+
timeout-minutes: 20
7182
run: |
7283
cd build
73-
python3 -m pytest test/ --timeout=300 --junitxml=test-results.xml --maxfail=99
74-
timeout-minutes: 20
84+
python3 -m pytest --maxfail=99 --timeout=300 --junitxml=test-results.xml test/
7585
76-
- name: upload test results
86+
- name: Upload test results
7787
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
7888
if: always()
7989
with:
80-
name: test-results
90+
name: test-results-${{ matrix.compiler }}
8191
path: |
8292
build/test-results.xml
8393
build/meson-logs/

0 commit comments

Comments
 (0)