22
33on :
44 push :
5- branches : [ main ]
5+ branches : [ main, master ]
66 pull_request :
7- branches : [ main ]
7+ branches : [ main, master ]
88
99env :
1010 CARGO_TERM_COLOR : always
@@ -16,26 +16,35 @@ jobs:
1616 runs-on : ${{ matrix.os }}
1717 strategy :
1818 matrix :
19- os : [ubuntu-latest, windows-latest, macos -latest]
20- rust : [stable, beta]
19+ os : [ubuntu-latest, windows-latest, macOS -latest]
20+ rust : [stable, beta, nightly ]
2121 steps :
2222 - uses : actions/checkout@v4
2323 - name : Install Rust
2424 uses : dtolnay/rust-toolchain@master
2525 with :
2626 toolchain : ${{ matrix.rust }}
27- - name : Cache dependencies
28- uses : actions/cache@v3
27+ - name : Cache cargo registry
28+ uses : actions/cache@v4
2929 with :
30- path : |
31- ~/.cargo/registry
32- ~/.cargo/git
33- target
34- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
30+ path : ~/.cargo/registry
31+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
32+ - name : Cache cargo index
33+ uses : actions/cache@v4
34+ with :
35+ path : ~/.cargo/git
36+ key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
37+ - name : Cache cargo build
38+ uses : actions/cache@v4
39+ with :
40+ path : target
41+ key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
3542 - name : Build
3643 run : cargo build --verbose
3744 - name : Run tests
3845 run : cargo test --verbose
46+ - name : Run doc tests
47+ run : cargo test --doc --verbose
3948
4049 fmt :
4150 name : Rustfmt
4554 - uses : dtolnay/rust-toolchain@stable
4655 with :
4756 components : rustfmt
48- - name : Check formatting
49- run : cargo fmt -- --check
57+ - run : cargo fmt --all -- --check
5058
5159 clippy :
5260 name : Clippy
@@ -57,24 +65,42 @@ jobs:
5765 with :
5866 components : clippy
5967 - name : Run clippy
60- run : cargo clippy -- -D warnings -W clippy:: all -W clippy::pedantic -W clippy::nursery -A clippy::module_name_repetitions
68+ run : cargo clippy --all-targets -- all-features -- -D warnings
6169
62- doc :
63- name : Documentation
70+ coverage :
71+ name : Code coverage
6472 runs-on : ubuntu-latest
6573 steps :
6674 - uses : actions/checkout@v4
6775 - uses : dtolnay/rust-toolchain@stable
68- - name : Check documentation
69- run : cargo doc --no-deps --document-private-items
70- env :
71- RUSTDOCFLAGS : -D warnings
76+ - name : Install tarpaulin
77+ run : cargo install cargo-tarpaulin
78+ - name : Generate code coverage
79+ run : cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
80+ - name : Upload coverage to Codecov
81+ uses : codecov/codecov-action@v4
82+ with :
83+ file : cobertura.xml
84+ fail_ci_if_error : true
85+
86+ security_audit :
87+ name : Security audit
88+ runs-on : ubuntu-latest
89+ steps :
90+ - uses : actions/checkout@v4
91+ - uses : rustsec/audit-check@v1.4.1
92+ with :
93+ token : ${{ secrets.GITHUB_TOKEN }}
7294
73- publish-dry-run :
74- name : Publish dry run
95+ examples :
96+ name : Examples
7597 runs-on : ubuntu-latest
7698 steps :
7799 - uses : actions/checkout@v4
78100 - uses : dtolnay/rust-toolchain@stable
79- - name : Cargo publish dry run
80- run : cargo publish --dry-run
101+ - name : Run basic example
102+ run : cargo run --example basic
103+ - name : Run batch validation example
104+ run : cargo run --example batch_validation
105+ - name : Run LLM-friendly example
106+ run : cargo run --example llm_friendly
0 commit comments