forked from google/mdbook-i18n-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (70 loc) · 1.97 KB
/
test.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
name: tests
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
FORCE_COLOR: 3
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test
fuzz:
name: Fuzz test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install nightly Rust
run: rustup default nightly
- uses: Swatinem/rust-cache@v2
with:
workspaces: fuzz -> target
- name: Install cargo-fuzz
run: cargo install cargo-fuzz
- name: Cache fuzz corpus
uses: actions/cache@v3
with:
path: fuzz/corpus
key: fuzz-corpus-${{ github.run_id }}
restore-keys: |
fuzz-corpus
- name: Run group_events fuzzer and minimize corpus
run: |
cargo fuzz run group_events -- -only_ascii=1 -max_total_time=30
cargo fuzz cmin group_events
- name: Run normalize fuzzer and minimize corpus
run: |
cargo fuzz run normalize -- -only_ascii=1 -max_total_time=30
cargo fuzz cmin normalize
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy -- -D clippy::dbg_macro -D clippy::print_stdout -D clippy::print_stderr
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# We use an unstable rustmft feature and we thus need the
# nightly channel to enforce the formatting.
- name: Setup Rust nightly
run: rustup default nightly
- name: Install rustfmt
run: rustup component add rustfmt
- name: Check Formatting
uses: dprint/[email protected]