@@ -2,35 +2,103 @@ name: CI
22
33on :
44 push :
5+ branches : [ master ]
56 pull_request :
6- schedule : [cron: "40 1 * * *"]
7+ branches : [ master ]
8+
9+ env :
10+ CARGO_INCREMENTAL : 0
11+ CARGO_TERM_COLOR : always
12+ RUST_BACKTRACE : 1
13+ RUSTFLAGS : -D warnings
14+ RUSTDOCFLAGS : -D warnings --cfg docsrs
715
816jobs :
9- test :
10- name : Rust ${{matrix.rust}}
17+ get-package-info :
1118 runs-on : ubuntu-latest
19+ outputs :
20+ msrv : ${{ steps.msrv.outputs.metadata }}
21+ name : ${{ steps.name.outputs.metadata }}
22+ version : ${{ steps.version.outputs.metadata }}
23+ steps :
24+ - uses : actions/checkout@v5
25+ - name : Get MSRV
26+ id : msrv
27+ uses :
nicolaiunrein/[email protected] 28+ with :
29+ subcommand : ' package.rust_version'
30+ - name : Get package name
31+ id : name
32+ uses :
nicolaiunrein/[email protected] 33+ with :
34+ subcommand : ' package.name'
35+ - name : Get package version
36+ id : version
37+ uses :
nicolaiunrein/[email protected] 38+ with :
39+ subcommand : ' package.version'
40+
41+ build_test :
42+ needs : get-package-info
43+ runs-on : ${{ matrix.os }}
1244 strategy :
13- fail-fast : false
1445 matrix :
15- rust : [nightly, beta, stable]
46+ os : [ ubuntu-latest, windows-latest ]
47+ rust :
48+ - ${{ needs.get-package-info.outputs.msrv }}
49+ - stable
50+ - beta
51+ - nightly
52+ exclude :
53+ # excludes MSRV on Windows due to linker issues
54+ - os : windows-latest
55+ rust : ${{ needs.get-package-info.outputs.msrv }}
1656 steps :
17- - uses : actions/checkout@v2
18- - uses : actions-rs/toolchain@v1
57+ - uses : actions/checkout@v5
58+ - name : Install toolchain
59+ if : matrix.rust != needs.get-package-info.outputs.msrv
60+ uses : dtolnay/rust-toolchain@master
1961 with :
20- toolchain : ${{matrix.rust}}
21- profile : minimal
22- override : true
23- - run : cargo build --features bench
62+ toolchain : ${{ matrix.rust }}
63+ components : rustfmt, clippy
64+ - name : Install MSRV toolchain
65+ if : matrix.rust == needs.get-package-info.outputs.msrv
66+ uses : dtolnay/rust-toolchain@master
67+ with :
68+ toolchain : ${{ needs.get-package-info.outputs.msrv }}
69+ - name : Remove dev-dependencies for MSRV (very dirty hack)
70+ if : matrix.rust == needs.get-package-info.outputs.msrv
71+ shell : pwsh
72+ run : |
73+ (Get-Content Cargo.toml) -replace '^\[dev-dependencies\].*?(\n\[|$)', '[placeholder]' | Set-Content Cargo.toml
74+ - name : Build
75+ run : cargo build --verbose
76+ - name : Run tests with all features
77+ run : cargo test --all-features --verbose
2478 if : matrix.rust == 'nightly'
25- - run : cargo test --features bench
79+ - name : Run tests without features
80+ run : cargo test --no-default-features --verbose
81+ - name : Package
82+ run : cargo package --allow-dirty
83+ - name : Test package
84+ working-directory : target/package/${{ needs.get-package-info.outputs.name }}-${{ needs.get-package-info.outputs.version }}/
85+ run : cargo test --verbose
86+ - name : Test package without features
87+ working-directory : target/package/${{ needs.get-package-info.outputs.name }}-${{ needs.get-package-info.outputs.version }}/
88+ run : cargo test --no-default-features --verbose
89+ - name : Run benchmarks
90+ run : cargo bench --features bench --verbose
2691 if : matrix.rust == 'nightly'
27- - run : cargo bench --features bench
92+ - name : Build docs
93+ run : cargo doc --all-features --verbose
2894 if : matrix.rust == 'nightly'
29- - run : cargo build
95+
3096 tables :
3197 name : Verify tables
3298 runs-on : ubuntu-latest
3399 steps :
34- - uses : actions/checkout@v2
100+ - uses : actions/checkout@v5
101+ - name : Regenerate tables
102+ run : ./scripts/unicode.py && rustfmt tables.rs
35103 - name : Verify regenerated files
36- run : ./scripts/unicode.py && rustfmt tables.rs && diff tables.rs src/tables.rs
104+ run : diff tables.rs src/tables.rs
0 commit comments