| 1 |
name: Test |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
permissions: |
| 6 |
actions: read |
| 7 |
|
| 8 |
jobs: |
| 9 |
clang-format: |
| 10 |
# To pick up a newer clang |
| 11 |
runs-on: ubuntu-24.04 |
| 12 |
name: "clang-format" |
| 13 |
steps: |
| 14 |
- name: Checkout repository |
| 15 |
uses: actions/checkout@v4 |
| 16 |
- name: Install dependencies |
| 17 |
run: sudo ./hacking/installdeps.sh |
| 18 |
- name: Configure |
| 19 |
run: meson setup build --prefix=/usr |
| 20 |
- name: clang-format |
| 21 |
run: ninja -C build clang-format-check |
| 22 |
# This build doesn't enable ASAN, which e.g. makes it easier to use with Rust |
| 23 |
build: |
| 24 |
runs-on: ubuntu-latest |
| 25 |
name: "Build with ASAN" |
| 26 |
steps: |
| 27 |
- name: Checkout repository |
| 28 |
uses: actions/checkout@v3 |
| 29 |
- name: Install dependencies |
| 30 |
run: sudo ./hacking/installdeps.sh |
| 31 |
- name: Install fsck.erofs |
| 32 |
run: sudo apt install erofs-utils |
| 33 |
- name: Install go-md2man |
| 34 |
run: sudo apt install go-md2man |
| 35 |
- name: Configure |
| 36 |
run: meson setup build --prefix=/usr --werror -Db_sanitize=address,undefined |
| 37 |
- name: Build |
| 38 |
run: meson compile -C build |
| 39 |
- name: Unit tests |
| 40 |
run: meson test -C build |
| 41 |
- name: Capture build |
| 42 |
run: DESTDIR=$(pwd)/instroot meson install -C build && tar -C instroot -czf composefs.tar . |
| 43 |
- name: Upload binary |
| 44 |
uses: actions/upload-artifact@v4 |
| 45 |
with: |
| 46 |
name: composefs.tar |
| 47 |
path: composefs.tar |
| 48 |
- name: Upload log |
| 49 |
uses: actions/upload-artifact@v4 |
| 50 |
if: always() |
| 51 |
with: |
| 52 |
name: testlog-asan.txt |
| 53 |
path: build/meson-logs/testlog.txt |
| 54 |
# This build doesn't enable ASAN, which e.g. makes it easier to use with Rust |
| 55 |
build-noasan: |
| 56 |
runs-on: ubuntu-latest |
| 57 |
name: "Build without ASAN" |
| 58 |
steps: |
| 59 |
- name: Checkout repository |
| 60 |
uses: actions/checkout@v3 |
| 61 |
- name: Install dependencies |
| 62 |
run: sudo ./hacking/installdeps.sh |
| 63 |
- name: Configure |
| 64 |
run: meson setup build --prefix=/usr --werror |
| 65 |
- name: Build |
| 66 |
run: meson compile -C build |
| 67 |
- name: Capture build |
| 68 |
run: DESTDIR=$(pwd)/instroot meson install -C build && tar -C instroot -czf composefs.tar . |
| 69 |
- name: Upload binary |
| 70 |
uses: actions/upload-artifact@v4 |
| 71 |
with: |
| 72 |
name: composefs-noasan.tar |
| 73 |
path: composefs.tar |
| 74 |
- name: Upload log |
| 75 |
uses: actions/upload-artifact@v4 |
| 76 |
if: always() |
| 77 |
with: |
| 78 |
name: testlog-noasan.txt |
| 79 |
path: build/meson-logs/testlog.txt |
| 80 |
build-baseline: |
| 81 |
runs-on: ubuntu-latest |
| 82 |
name: "Build on Ubuntu Focal" |
| 83 |
container: ubuntu:focal |
| 84 |
steps: |
| 85 |
- name: Checkout repository |
| 86 |
uses: actions/checkout@v4 |
| 87 |
- name: Install dependencies |
| 88 |
run: | |
| 89 |
apt-get update -y |
| 90 |
ALLOW_MISSING="libfsverity-dev" ./hacking/installdeps.sh |
| 91 |
- name: Configure |
| 92 |
run: meson setup build --werror |
| 93 |
- name: Build |
| 94 |
# focal's meson is too old for 'meson compile' |
| 95 |
run: ninja -C build |
| 96 |
build-latest-clang: |
| 97 |
runs-on: ubuntu-24.04 |
| 98 |
name: "Build (24.04, clang)" |
| 99 |
steps: |
| 100 |
- name: Checkout repository |
| 101 |
uses: actions/checkout@v4 |
| 102 |
- name: Install dependencies |
| 103 |
run: sudo ./hacking/installdeps.sh |
| 104 |
- name: Configure |
| 105 |
run: env CC=clang meson setup build --werror |
| 106 |
- name: Build |
| 107 |
# focal's meson is too old for 'meson compile' |
| 108 |
run: meson compile -C build |
| 109 |
build-unit-cross: |
| 110 |
runs-on: ubuntu-latest |
| 111 |
name: Build on ${{ matrix.arch }} |
| 112 |
|
| 113 |
strategy: |
| 114 |
matrix: |
| 115 |
include: |
| 116 |
- arch: armv7 |
| 117 |
distro: bullseye |
| 118 |
- arch: aarch64 |
| 119 |
distro: bullseye |
| 120 |
- arch: s390x |
| 121 |
distro: bullseye |
| 122 |
- arch: ppc64le |
| 123 |
distro: bullseye |
| 124 |
steps: |
| 125 |
- uses: actions/[email protected] |
| 126 |
with: |
| 127 |
submodules: true |
| 128 |
set-safe-directory: true |
| 129 |
|
| 130 |
- uses: uraimo/[email protected] |
| 131 |
name: Build |
| 132 |
id: build |
| 133 |
with: |
| 134 |
arch: ${{ matrix.arch }} |
| 135 |
distro: ${{ matrix.distro }} |
| 136 |
|
| 137 |
githubToken: ${{ github.token }} |
| 138 |
|
| 139 |
run: | |
| 140 |
apt-get update -y |
| 141 |
./hacking/installdeps.sh |
| 142 |
meson setup build --werror |
| 143 |
meson compile -C build |
| 144 |
env CFS_TEST_ARCH_EMULATION=${{ matrix.arch }} meson test -C build --timeout-multiplier 10 |
| 145 |
- name: Upload log |
| 146 |
uses: actions/upload-artifact@v4 |
| 147 |
if: always() |
| 148 |
with: |
| 149 |
name: testlog-${{ matrix.arch }} |
| 150 |
path: build/meson-logs/testlog.txt |
| 151 |
integration: |
| 152 |
needs: build |
| 153 |
runs-on: ubuntu-latest |
| 154 |
|
| 155 |
steps: |
| 156 |
- run: sudo apt-get update -y |
| 157 |
- name: Install erofs kmod |
| 158 |
run: sudo apt install linux-modules-extra-$(uname -r) |
| 159 |
- name: Install dependencies |
| 160 |
run: sudo apt install libasan6 libubsan1 fsverity |
| 161 |
- name: Checkout repository |
| 162 |
uses: actions/checkout@v3 |
| 163 |
- name: Download |
| 164 |
uses: actions/download-artifact@v4 |
| 165 |
with: |
| 166 |
name: composefs.tar |
| 167 |
- run: sudo tar -C / -xvf composefs.tar |
| 168 |
- name: Integration tests |
| 169 |
run: sudo ./tests/integration.sh |
| 170 |
- name: Integration tests (fsverity required) |
| 171 |
run: sudo env WITH_TEMP_VERITY=1 unshare -m ./tests/integration.sh |
| 172 |
distcheck: |
| 173 |
runs-on: ubuntu-latest |
| 174 |
steps: |
| 175 |
- name: Checkout repository |
| 176 |
uses: actions/checkout@v3 |
| 177 |
- name: Install dependencies |
| 178 |
run: sudo ./hacking/installdeps.sh |
| 179 |
- name: Configure |
| 180 |
run: meson setup build --werror |
| 181 |
- name: Run make distcheck |
| 182 |
run: meson dist -C build |