-
Notifications
You must be signed in to change notification settings - Fork 1
151 lines (139 loc) · 5.21 KB
/
Copy pathcheck.yml
File metadata and controls
151 lines (139 loc) · 5.21 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Check
on:
push:
branches: [master, ci]
pull_request:
branches: [master]
env:
RUST_VERSION: 1.85
# clippy::needless lifetimes is a little bit overzealous on 1.85 and conflicts
# with what nightly thinks (fixing this lint will trigger another lint on nightly)
# clippy::comparison-chain has since been moved to pedantic
STABLE_CLIPPY_OPTIONS: -D warnings -A clippy::needless_lifetimes -A clippy::comparison_chain
jobs:
run-tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The layout test suite and xxtask does not follow crate msrv.
- run: rustup default nightly
- uses: Swatinem/rust-cache@v2
- run: cargo xxtask ptr pull tests/assets/*.ptr
- run: sudo apt update && sudo apt install -y build-essential libfontconfig-dev libfreetype-dev libharfbuzz-dev
- name: Install nextest
uses: taiki-e/install-action@nextest
- run: cargo nextest r -F _layout_tests --workspace --exclude sbr-overlay --no-fail-fast
nix-build:
name: Build nix flake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- run: nix flake check
- run: nix build --print-build-logs .
check-linux:
name: Check ${{ matrix.name }}
runs-on: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- name: x86_64 Linux
image: ubuntu-latest
- name: i686 Linux
# On ubuntu-latest every time I enabled this check it eventually started
# failing with apt complaining it can't install some packages.
# So try with an older ubuntu image, surely it won't break itself right?
image: ubuntu-22.04
cross-arch: i686
rustc-cross-target: i686-unknown-linux-gnu
extra-cflags: -m32
extra-packages: gcc-multilib
- name: aarch64 Linux
image: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- run:
rustup toolchain install $RUST_VERSION
--component clippy,rustfmt ${TARGET:+--target} $TARGET
env:
TARGET: ${{ matrix.rustc-cross-target }}
- run: rustup default $RUST_VERSION
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.cross-arch }}
- run: ./ci/ubuntu_install_packages.sh
env:
CROSS_ARCH: ${{ matrix.cross-arch }}
EXTRA_PACKAGES: ${{ matrix.extra-packages }}
LIBRARIES: libfontconfig-dev libfreetype-dev libharfbuzz-dev
- run: cargo fmt --all -- --check
- run:
cargo clippy --workspace
--exclude sbr-overlay --exclude xtask --exclude subrandr
--all-targets --all-features -- $STABLE_CLIPPY_OPTIONS
# The xtask is checked separately because it cannot be tested with `--all-features` as
# the "full" feature does not follow our MSRV (yet).
- run: cargo clippy -p xtask --all-targets -- $STABLE_CLIPPY_OPTIONS
# The subrandr crate is checked separately because it has a `_layout_tests` feature which
# also does not follow our MSRV.
- run: cargo clippy --no-deps -p subrandr --features wgpu --all-targets -- $STABLE_CLIPPY_OPTIONS
- run: ./ci/c_sanity_check.sh
env:
CROSS_TARGET: ${{ matrix.rustc-cross-target }}
CFLAGS: ${{ matrix.extra-cflags }}
check-wasi:
name: Check wasm32-wasip1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install $RUST_VERSION --target wasm32-wasip1
- run: rustup default $RUST_VERSION
- uses: Swatinem/rust-cache@v2
- run: sudo apt update && sudo apt install -y build-essential
- name: Cache wasi dependencies
id: cache-wasi-deps
uses: actions/cache@v4
with:
key: wasi-deps-${{ hashFiles('wasi32/Dependencies.Dockerfile') }}
path: wasi32/deps
- run: |
cd wasi32
./build_dependencies.sh
if: ${{ steps.cache-wasi-deps.outputs.cache-hit != 'true' }}
- run: cargo build --target wasm32-wasip1 -p subrandr --all-features
check-windows:
name: Check ${{ matrix.name }}
runs-on: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- name: x86_64 Windows
image: windows-latest
msystem: MINGW64
- name: aarch64 Windows
image: windows-11-arm
msystem: CLANGARM64
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: git
pacboy: >-
gcc:p
freetype:p
harfbuzz:p
rust:p
- uses: Swatinem/rust-cache@v2
- shell: msys2 {0}
run: cargo clippy --workspace --exclude sbr-overlay --exclude xtask --all-features -- -D warnings
- shell: msys2 {0}
# Similar to above but it can't be tested with `--all-features` because ring doesn't
# even compile on aarch64 Windows apparently.
run: cargo clippy -p xtask --all-targets -- -D warnings
- shell: msys2 {0}
run: ./ci/c_sanity_check.sh