53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Get MSRV
|
|
id: msrv
|
|
run: |
|
|
echo "msrv=$(
|
|
awk '/^rust-version = "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+"$/ {
|
|
print substr($NF, 2, length($NF) - 2)
|
|
}' Cargo.toml)" >> "$GITHUB_OUTPUT"
|
|
- name: Set XDG_RUNTIME_DIR
|
|
id: xrd
|
|
run: echo "testdir=$PWD/test-xwls" >> "$GITHUB_OUTPUT"
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y xwayland clang libxcb1 libxcb-cursor0 libxcb-cursor-dev pkg-config libegl1
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ steps.msrv.outputs.msrv }}
|
|
components: clippy, rustfmt
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Build
|
|
run: cargo build --all-targets --profile ci --locked --verbose
|
|
- name: Run tests
|
|
run: |
|
|
mkdir "$XDG_RUNTIME_DIR"
|
|
cargo test --profile ci --locked --verbose -- --test-threads 1 --nocapture
|
|
env:
|
|
XDG_RUNTIME_DIR: ${{ steps.xrd.outputs.testdir }}
|
|
- name: Format check
|
|
run: cargo fmt --check
|
|
- name: Clippy
|
|
run: cargo clippy --profile ci --locked --workspace --all-targets
|