Repository navigation
97 lines (91 loc) · 3.79 KB
/
Copy pathci.yml
File metadata and controls
97 lines (91 loc) · 3.79 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Tests and lints on every push and pull request: the whole workspace on Windows, on Linux and on macOS (test suite,
# clippy with warnings as errors; on Windows also the documentation pages); all jobs are required. The test suite includes the licence check of
# the shipped dependencies (crates/mc-bench/tests/notices.rs). Packages come from nightly.yml (every push to main,
# the rolling `nightly` pre-release) and release.yml (tags v<version>), both through packages.yml.
name: CI
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# line tables only in CI: smaller target folders, faster links
CARGO_PROFILE_RELEASE_DEBUG: "0"
# the documentation examples' speed limit is 1 s on a development machine; the shared runners are slower
MC_DOCS_SLOW_SECS: "4"
# speed assertions in tests are written for a development machine too
MC_TEST_TIME_FACTOR: "4"
jobs:
windows:
name: Windows (tests, clippy)
runs-on: windows-latest
# a build without a cached target folder takes about 85 minutes (clippy, the suite, the documentation pages);
# the limit leaves room for it and for saving the cache, so that the next run is a warm one
timeout-minutes: 150
steps:
- uses: actions/checkout@v4
- name: Rust toolchain
run: rustup toolchain install stable --profile minimal --component clippy && rustup default stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: win-ci-${{ hashFiles('Cargo.lock') }}
restore-keys: win-ci-
- name: Clippy
run: cargo clippy --release --locked --workspace --all-targets -- -D warnings
- name: Test suite
run: cargo test --release --locked --workspace --no-fail-fast
- name: Documentation pages match a fresh run
run: cargo run --release --locked -p mc-docs --bin mc-docs-pages -- check
linux:
name: Linux (tests, clippy)
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- name: System libraries for the windowing crates
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxi-dev libxcursor-dev libxrandr-dev libgl-dev libfontconfig-dev
- name: Rust toolchain
run: rustup toolchain install stable --profile minimal --component clippy && rustup default stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: linux-ci-${{ hashFiles('Cargo.lock') }}
restore-keys: linux-ci-
- name: Clippy
run: cargo clippy --release --locked --workspace --all-targets -- -D warnings
- name: Test suite
run: cargo test --release --locked --workspace --no-fail-fast
# the page outputs are recorded on Windows (machine-real last bits and OS error texts differ); checked there
macos:
name: macOS (tests, clippy)
runs-on: macos-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- name: Rust toolchain
run: rustup toolchain install stable --profile minimal --component clippy && rustup default stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: macos-ci-${{ hashFiles('Cargo.lock') }}
restore-keys: macos-ci-
- name: Clippy
run: cargo clippy --release --locked --workspace --all-targets -- -D warnings
- name: Test suite
run: cargo test --release --locked --workspace --no-fail-fast