Repository navigation
271 lines (218 loc) · 9.08 KB
/
Copy pathrust.yml
File metadata and controls
271 lines (218 loc) · 9.08 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
on:
pull_request:
push:
branches:
- main
tags:
- "*"
schedule:
- cron: '22 2 * * *' # run at 2:22 every day
name: Continuous integration
permissions:
contents: read
env:
# CI builds start from nothing and are thrown away, so incremental state is
# only overhead.
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
jobs:
check:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: |
rustup toolchain install stable --profile minimal --no-self-update --component rustfmt
rustup default stable
- name: rustfmt check
run: cargo fmt --all -- --check
- name: cargo doc
run: cargo doc --all-features --document-private-items --no-deps
env:
RUSTDOCFLAGS: -D warnings
- name: check no println! or eprintln! statements
run: resources/scripts/check_no_println.sh
clippy-lint:
name: Clippy lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install stable toolchain
run: |
rustup toolchain install 1.89 --profile minimal --no-self-update --component clippy
rustup default 1.89
- name: cargo clippy font-types (1.89)
run: cargo clippy -p font-types --all-features --all-targets -- -D warnings
- name: cargo clippy read-fonts (1.89)
run: cargo clippy -p read-fonts --all-features --all-targets -- -D warnings
- name: cargo clippy write-fonts (1.89)
run: cargo clippy -p write-fonts --all-features --all-targets -- -D warnings
- name: cargo clippy skrifa (1.89)
run: cargo clippy -p skrifa --all-features --all-targets -- -D warnings
- name: cargo clippy skera (1.89)
run: cargo clippy -p skera --all-features --all-targets -- -D warnings
- name: cargo clippy fauntlet (1.89)
run: cargo clippy -p fauntlet --all-features --all-targets -- -D warnings
- name: cargo clippy incremental-font-transfer (1.89)
run: cargo clippy -p incremental-font-transfer --all-features --all-targets -- -D warnings
check-msrv:
name: cargo check msrv
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install stable toolchain
run: |
rustup toolchain install 1.85 --profile minimal --no-self-update
rustup default 1.85
- name: cargo check
run: cargo check --workspace
test-stable:
name: cargo test stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install stable toolchain
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
# test all packages individually to ensure deterministic resolution
# of dependencies for each package
- name: cargo test font-types (default)
run: cargo test -p font-types
- name: cargo test font-types (all)
run: cargo test -p font-types --all-targets --all-features
- name: cargo test read-fonts (default)
run: cargo test -p read-fonts
- name: cargo test read-fonts (all)
run: cargo test -p read-fonts --all-targets --all-features
- name: cargo test write-fonts (default)
run: cargo test -p write-fonts
- name: cargo test write-fonts (no-features)
# --tests makes it so we run only the unit tests and skip the doctests.
# The doctests assume that "tables" is enabled.
run: cargo test -p write-fonts --no-default-features --tests
- name: cargo test write-fonts (all)
run: cargo test -p write-fonts --all-targets --all-features
- name: cargo test skrifa (default)
run: cargo test -p skrifa
- name: cargo test skrifa (all)
run: cargo test -p skrifa --all-targets --all-features
- name: cargo test skera
run: |
pip install -r resources/scripts/skera_ci_requirements.txt
cargo test -p skera --all-targets --all-features
# The slow tests are disabled by default. We may re-enable if the
# tests become faster.
# https://github.com/googlefonts/fontations/issues/1910
cargo test -p skera --all-targets --all-features -- --ignored
- name: cargo test skera (no cli)
run: cargo test -p skera --no-default-features
- name: cargo test incremental-font-transfer
run: cargo test -p incremental-font-transfer --all-targets --all-features
- name: cargo test shared-brotli-patch-decoder
run: cargo test -p shared-brotli-patch-decoder --all-targets --all-features
# --all-features selects the c-brotli backend, so test the rust-brotli backend on its own.
- name: cargo test shared-brotli-patch-decoder (rust-brotli)
run: cargo test -p shared-brotli-patch-decoder --all-targets --no-default-features --features rust-brotli
verify-licenses:
name: Verify licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Verify licenses
run: resources/scripts/check_licenses.sh
ensure-clean-codegen:
name: check codegen is up-to-date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install stable toolchain
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: run codegen
run: cargo run --bin=codegen resources/codegen_plan.toml
- name: ensure no unstaged changes
run: |
git add .
git status -sb
git diff-index --quiet HEAD --
check-no-std:
name: cargo check no std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install stable toolchain
# Use a target without `std` to make sure we don't link to `std`
run: |
rustup toolchain install 1.89 --profile minimal --no-self-update --target thumbv7em-none-eabihf
rustup default 1.89
- name: cargo build font-types
run: cargo build -p font-types --target thumbv7em-none-eabihf --no-default-features
- name: cargo build read-fonts
run: cargo build -p read-fonts --target thumbv7em-none-eabihf --no-default-features --features=libm
- name: cargo build skrifa
run: cargo build -p skrifa --target thumbv7em-none-eabihf --no-default-features --features=libm
# We use `cargo build` here because `cargo check` doesn't pick up all
# warnings / errors. Notably, it misses `arithmetic_overflow`.
check-wasm:
name: cargo check wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install stable toolchain
run: |
rustup toolchain install 1.89 --profile minimal --no-self-update --target wasm32-unknown-unknown
rustup default 1.89
- name: cargo build font-types
run: cargo build -p font-types --target wasm32-unknown-unknown
- name: cargo build read-fonts
run: cargo build -p read-fonts --target wasm32-unknown-unknown
- name: cargo build skrifa
run: cargo build -p skrifa --target wasm32-unknown-unknown
- name: cargo build write-fonts
run: cargo build -p write-fonts --target wasm32-unknown-unknown
typos:
name: Check for typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: check typos
uses: crate-ci/typos@512fc24f32f44ab01972217aaaf3dc86ec234d53 # v1.50.2
- name: typo instructions
if: failure()
run: |
echo "::error::Fix "check typos" or add an entry in .typos.toml"
exit 1
fauntlet:
name: fauntlet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: fauntlet compare
run: cargo run --release -p fauntlet -- compare-glyphs --print-paths --hinting-engine all --hinting-target all --exit-on-fail fauntlet/test_fonts/*.*tf
- name: fauntlet compare type1
run: cargo run --release -p fauntlet -- compare-glyphs --print-paths --exit-on-fail font-test-data/test_data/type1/*.pf*