Files
uur/.github/workflows/ci.yml
T
Xuc Pan 0d0820da7e fix(ci): support older MinGW and Nix builds
Declare the Windows API level required by the terminal proxy so Ubuntu 22.04 MinGW exposes CancelSynchronousIo. Patch script shebangs inside the Nix sandbox, install the target-triple Rust binary through the shared staging script, and keep Nix CI resource usage bounded.
2026-09-05 13:33:25 +08:00

85 lines
2.6 KiB
YAML

name: ci
on:
push:
branches: [master]
pull_request:
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Rust checks
run: |
cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked --all-targets
cc -std=c11 -O2 -Wall -Wextra -Werror tests/frame-protocol.c -o /tmp/frame-protocol
/tmp/frame-protocol
- name: Build
run: cargo build --locked --release
hook:
runs-on: ubuntu-latest
container: archlinux:base-devel
steps:
- uses: actions/checkout@v4
- name: Install mingw toolchain
run: |
pacman -Syu --noconfirm mingw-w64-gcc mingw-w64-binutils
- name: Build PE components
run: ./hook/build.sh
- uses: actions/upload-artifact@v4
with:
name: uur-hook-pe
path: build/hook/*.dll
package-layout:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install native and PE build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
appstream binutils-mingw-w64-x86-64 desktop-file-utils \
gcc gcc-mingw-w64-x86-64 libpipewire-0.3-dev pkg-config \
wine xvfb
- name: Build and stage
run: |
cargo build --release --locked
./hook/build.sh
./capture/build.sh
stage="$(mktemp -d)"
./packaging/stage.sh "$stage"
test -x "$stage/usr/bin/uur"
test -x "$stage/usr/lib/uur/uur-pw-capture"
test -f "$stage/usr/lib/uur/hook/winlogon.exe"
desktop-file-validate "$stage/usr/share/applications/uur.desktop"
appstreamcli validate --no-net "$stage/usr/share/metainfo/io.github.panxuc.uur.metainfo.xml"
./tests/hook-smoke.sh
./tests/terminal-smoke.sh
alpine-musl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and test the musl package layout
run: docker build --target build -f packaging/alpine/Dockerfile .
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- name: Evaluate and build the flake
run: |
nix flake check --no-build
CARGO_BUILD_JOBS=1 NIX_BUILD_CORES=1 \
nix build .#uur --max-jobs 1 --cores 1