Add FreeBSD CI (#2072)
Browse files at this commit1 changed file +43 -1
- .github/workflows/ci.yml +43 -1
.github/workflows/ci.ymlmodified+43 -1
| @@ -12,6 +12,7 @@ env: | |||
| 12 | DEPS_APT: curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libdisplay-info-dev | 12 | DEPS_APT: curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libdisplay-info-dev |
| 13 | DEPS_DNF: cargo gcc clang libudev-devel libgbm-devel libxkbcommon-devel wayland-devel libinput-devel dbus-devel systemd-devel libseat-devel pipewire-devel pango-devel cairo-gobject-devel libdisplay-info-devel | 13 | DEPS_DNF: cargo gcc clang libudev-devel libgbm-devel libxkbcommon-devel wayland-devel libinput-devel dbus-devel systemd-devel libseat-devel pipewire-devel pango-devel cairo-gobject-devel libdisplay-info-devel |
| 14 | DEPS_APK: cargo clang-libclang eudev-dev glib-dev libdisplay-info-dev libinput-dev libseat-dev libxkbcommon-dev mesa-dev pango-dev pipewire-dev tar | 14 | DEPS_APK: cargo clang-libclang eudev-dev glib-dev libdisplay-info-dev libinput-dev libseat-dev libxkbcommon-dev mesa-dev pango-dev pipewire-dev tar |
| 15 | + DEPS_PKG: git curl rust llvm pkgconf pixman libudev-devd libdisplay-info seatd libinput libxkbcommon pipewire mesa-libs cairo devel/glib20 gettext-runtime harfbuzz pango | ||
| 15 | 16 | ||
| 16 | jobs: | 17 | jobs: |
| 17 | build: | 18 | build: |
| @@ -85,7 +86,7 @@ jobs: | |||
| 85 | 86 | ||
| 86 | - name: Install Deps | 87 | - name: Install Deps |
| 87 | run: apk add --no-cache ${{ env.DEPS_APK }} | 88 | run: apk add --no-cache ${{ env.DEPS_APK }} |
| 88 | - | 89 | + |
| 89 | - uses: Swatinem/rust-cache@v2 | 90 | - uses: Swatinem/rust-cache@v2 |
| 90 | 91 | ||
| 91 | - name: Build | 92 | - name: Build |
| @@ -231,6 +232,47 @@ jobs: | |||
| 231 | - uses: Swatinem/rust-cache@v2 | 232 | - uses: Swatinem/rust-cache@v2 |
| 232 | - run: cargo build --all | 233 | - run: cargo build --all |
| 233 | 234 | ||
| 235 | + freebsd: | ||
| 236 | + runs-on: ubuntu-24.04 | ||
| 237 | + env: | ||
| 238 | + CARGO_HOME: /home/runner/work/niri/niri/cargo-home | ||
| 239 | + | ||
| 240 | + steps: | ||
| 241 | + - uses: actions/checkout@v4 | ||
| 242 | + with: | ||
| 243 | + show-progress: false | ||
| 244 | + | ||
| 245 | + # Required for the rust-cache action to work. | ||
| 246 | + - uses: dtolnay/rust-toolchain@stable | ||
| 247 | + | ||
| 248 | + # FIXME: doesn't seem to cache the builds, only the downloads for some unknown reason. | ||
| 249 | + - uses: Swatinem/rust-cache@v2 | ||
| 250 | + with: | ||
| 251 | + cache-all-crates: true | ||
| 252 | + | ||
| 253 | + # Remove man-db triggers to speed up Ubuntu upgrade by a minute or two during vmactions/freebsd-vm action run. | ||
| 254 | + - run: | | ||
| 255 | + sudo rm /var/lib/dpkg/info/man-db.* | ||
| 256 | + | ||
| 257 | + - name: Build | ||
| 258 | + uses: vmactions/freebsd-vm@966989c456d41351f095a421f60e71342d3bce41 # v1.2.1 | ||
| 259 | + with: | ||
| 260 | + prepare: | | ||
| 261 | + pkg update -f | ||
| 262 | + pkg install -y ${{ env.DEPS_PKG }} | ||
| 263 | + run: | | ||
| 264 | + curl -o patch-pipewire_init 'https://cgit.freebsd.org/ports/plain/x11-wm/niri/files/patch-pipewire_init?id=f3f7e555b06d9a87d63c047ce3e82e936a11f2fe' | ||
| 265 | + | ||
| 266 | + export CARGO_HOME="$PWD/cargo-home" | ||
| 267 | + | ||
| 268 | + cargo fetch | ||
| 269 | + | ||
| 270 | + ( cd $CARGO_HOME/git/checkouts/pipewire-rs-*/*/; patch -p2 < $CARGO_HOME/../patch-pipewire_init; ) | ||
| 271 | + | ||
| 272 | + cargo build \ | ||
| 273 | + --offline \ | ||
| 274 | + --no-default-features --features dbus,xdp-gnome-screencast | ||
| 275 | + | ||
| 234 | nix: | 276 | nix: |
| 235 | runs-on: ubuntu-24.04 | 277 | runs-on: ubuntu-24.04 |
| 236 | steps: | 278 | steps: |