50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: "1.95"
|
|
components: clippy, rustfmt
|
|
- run: scripts/check.sh
|
|
- run: cargo build --locked
|
|
|
|
platforms:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-24.04, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
# Debuginfo makes the Linux link outgrow its VM's memory.
|
|
env:
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: "1.95"
|
|
# On a host runner its post step deletes the host's rustup.
|
|
- if: runner.os == 'Linux'
|
|
uses: Swatinem/rust-cache@v2
|
|
- if: runner.os != 'Linux'
|
|
run: cargo test --locked --quiet
|
|
# The Linux job container runs as root, which ignores the file permissions the tests check.
|
|
- if: runner.os == 'Linux'
|
|
run: |
|
|
apt-get update && apt-get install -y --no-install-recommends pkg-config libwayland-dev \
|
|
libxkbcommon-dev libxkbcommon-x11-dev libxcb1-dev libx11-xcb-dev libfontconfig-dev \
|
|
libfreetype-dev zsh fish xvfb
|
|
useradd --create-home ci
|
|
chmod o+x "$HOME"
|
|
chown -R ci "$GITHUB_WORKSPACE" "$HOME/.cargo" "$HOME/.rustup"
|
|
runuser -u ci -- env HOME=/home/ci CARGO_HOME="$HOME/.cargo" RUSTUP_HOME="$HOME/.rustup" PATH="$PATH" cargo test --locked --quiet
|
|
- run: cargo build --locked
|