Repository navigation
69 lines (63 loc) · 2.06 KB
/
Copy pathci.yml
File metadata and controls
69 lines (63 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# SPDX-License-Identifier: GPL-2.0-only
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# CI does clean builds, so incremental just wastes time and cache space.
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
jobs:
# Formatting is platform-independent - run it once, fast.
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt --all -- --check
# clippy and test each compile the whole tree (in different profiles, so they
# cannot share artifacts). Running them as separate jobs lets them build in
# parallel on their own runners, roughly halving the wall-clock per OS vs. one
# sequential job. Both stay on the full OS matrix so platform- and cfg-gated
# code (e.g. the Windows-only updater paths) is still linted and tested.
clippy:
name: clippy (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: test
# Rune links xkbcommon on Linux for keyboard input.
- if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libxkbcommon-dev
- run: cargo test --all --all-features
deny:
name: cargo-deny (advisories, bans, sources)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
# Licenses are deliberately not checked; see docs/ARCHITECTURE.md §11.
command: check advisories bans sources