-
Notifications
You must be signed in to change notification settings - Fork 27
114 lines (89 loc) · 3.06 KB
/
rust.yml
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
on:
pull_request:
push:
branches:
- main
tags:
- "*"
schedule:
- cron: '22 2 * * *' # run at 2:22 every day
name: Continuous integration
jobs:
check:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add rustfmt
- 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@v3
- name: install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: cargo clippy --all-features
run: cargo clippy --all-features --all-targets -- -D warnings
- name: cargo clippy --no-default-features
run: cargo clippy --all-targets --no-default-features -- -D warnings
test-stable:
name: cargo test stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install stable toolchain
uses: dtolnay/rust-toolchain@stable
# test all packages individually to ensure deterministic resolution
# of dependencies for each package
- name: cargo test font-types
run: cargo test -p font-types --all-targets --all-features
- name: cargo test read-fonts
run: cargo test -p read-fonts --all-targets --all-features
- name: cargo test write-fonts
run: cargo test -p write-fonts --all-targets --all-features
- name: cargo test skrifa
run: cargo test -p skrifa --all-targets --all-features
ensure-clean-codegen:
name: check codegen is up-to-date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install stable toolchain
uses: dtolnay/rust-toolchain@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@v3
- name: install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: cargo check font-types
run: cargo check --manifest-path=font-types/Cargo.toml --no-default-features
- name: cargo check read-fonts
run: cargo check --manifest-path=read-fonts/Cargo.toml --no-default-features
check-wasm:
name: cargo check wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install stable toolchain
uses: dtolnay/rust-toolchain@stable
- run: rustup target add wasm32-unknown-unknown
- name: cargo check wasm target
run: cargo check --manifest-path=write-fonts/Cargo.toml --target wasm32-unknown-unknown