-
Notifications
You must be signed in to change notification settings - Fork 42
88 lines (85 loc) · 2.52 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
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings --cfg docsrs
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Build
run: cargo build --verbose
- name: Run tests with all features
run: cargo test --all-features --verbose
- name: Run tests without features
run: cargo test --no-default-features --verbose
- name: Package
run: cargo package
- name: Test package
run: cd $(find target/package/ -maxdepth 1 -mindepth 1 -type d) && cargo test
- name: Test package without features
run: cd $(find target/package/ -maxdepth 1 -mindepth 1 -type d) && cargo test --no-default-features
- name: Build docs
if: matrix.rust == 'nightly'
run: cargo doc --all-features --verbose
- name: Check formatting
if: matrix.rust == 'stable'
run: cargo fmt --all --check
- name: Check clippy
if: matrix.rust == 'stable'
run: cargo clippy --all-features --lib --tests --examples --verbose
- name: Check benchmarks with clippy
if: matrix.rust == 'nightly'
run: cargo clippy --all-features --benches --verbose
- name: Check fuzz tests with clippy
if: matrix.rust == 'stable'
working-directory: fuzz
run: cargo clippy --all-features --all-targets --verbose
- name: Check fuzz tests formatting
if: matrix.rust == 'stable'
working-directory: fuzz
run: cargo fmt --all --check
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install msrv toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.36
override: true
- name: Build
run: cargo build --verbose --all-features
regen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Regen
run: cd scripts && python3 unicode.py
- name: Diff tables
run: diff src/tables.rs scripts/tables.rs
- name: Diff tests
run: diff tests/data/normalization_tests.rs scripts/normalization_tests.rs