@@ -2,111 +2,94 @@ name: CI
22
33on :
44 pull_request :
5- branches :
6- - ' *'
5+ branches : [ "*" ]
6+ push :
7+ branches : ["main"]
8+
9+ env :
10+ CARGO_TERM_COLOR : " always"
11+ CARGO_INCREMENTAL : " 0"
12+ RUSTC_WRAPPER : " sccache"
13+ SCCACHE_GHA_ENABLED : " true"
14+ # Minimum supported Rust version.
15+ msrv : 1.85.0
16+ # Nightly Rust necessary for building docs.
17+ nightly : nightly-2025-05-23
718
819jobs :
9- fmt :
10- name : Rustfmt
20+ build-msrv :
1121 runs-on : ubuntu-latest
12-
22+ permissions :
23+ contents : read
1324 steps :
14- - name : Checkout sources
15- uses : actions/checkout@v2
16-
17- - name : Install rust
18- uses : actions-rs/toolchain@v1
19- with :
20- toolchain : stable
21- components : rustfmt
22- profile : minimal
23- override : true
24-
25- - name : Run rustfmt
26- uses : actions-rs/cargo@v1
27- with :
28- command : fmt
29- args : --all -- --check
30-
31- clippy :
32- name : Clippy
33- runs-on : ubuntu-latest
34-
35- steps :
36- - name : Checkout sources
37- uses : actions/checkout@v2
38-
39- - name : Install rust
40- uses : actions-rs/toolchain@v1
41- with :
42- toolchain : stable
43- components : clippy
44- profile : minimal
45- override : true
25+ - uses : actions/checkout@v4
4626
47- - name : Run clippy
48- uses : actions-rs/clippy-check@v1
27+ - name : Install Rust
28+ uses : dtolnay/rust-toolchain@master
4929 with :
50- token : ${{ secrets.GITHUB_TOKEN }}
51- args : -- -D warnings
30+ toolchain : ${{ env.msrv }}
31+ - name : Install sccache
32+ uses : mozilla-actions/sccache-action@v0.0.9
5233
53- audit :
54- name : Security audit
55- runs-on : ubuntu-latest
56-
57- steps :
58- - uses : actions/checkout@v2
59- - uses : actions-rs/audit-check@v1
60- with :
61- token : ${{ secrets.GITHUB_TOKEN }}
34+ - name : Build libraries
35+ run : cargo build --workspace --lib --all-features
6236
63- deadlinks :
64- name : Deadlinks
37+ build :
6538 runs-on : ubuntu-latest
66-
39+ permissions :
40+ contents : read
6741 steps :
6842 - name : Checkout sources
69- uses : actions/checkout@v2
43+ uses : actions/checkout@v4
7044
71- - name : Install rust
72- uses : actions-rs/ toolchain@v1
45+ - name : Install Rust
46+ uses : dtolnay/rust- toolchain@master
7347 with :
7448 toolchain : stable
75- profile : minimal
76- override : true
77-
78- - name : Install deadlinks
79- run : cargo install cargo-deadlinks
80-
81- - name : Cargo doc
82- run : cargo doc --no-deps
83-
84- - name : Run deadlinks
85- run : cargo deadlinks --dir target/doc
86-
87- test :
88- name : Test
49+ components : rustfmt, clippy, rust-src
50+ - name : Install sccache
51+ uses : mozilla-actions/sccache-action@v0.0.9
52+
53+ - name : Format
54+ run : cargo fmt --all -- --config imports_granularity=Crate --config group_imports=StdExternalCrate --check
55+ - name : Clippy
56+ run : cargo clippy --workspace --all-features --all-targets -- -D warnings
57+
58+ - name : Run tests
59+ run : cargo test --workspace --all-features --all-targets
60+ - name : Run doc tests
61+ run : cargo test --workspace --all-features --doc
62+
63+ build-nightly :
64+ needs :
65+ - build
66+ - build-msrv
8967 runs-on : ubuntu-latest
90-
68+ permissions :
69+ contents : write
9170 steps :
92- - name : Checkout sources
93- uses : actions/checkout@v2
71+ - uses : actions/checkout@v4
9472
95- - name : Install rust
96- uses : actions-rs/ toolchain@v1
73+ - name : Install Rust
74+ uses : dtolnay/rust- toolchain@master
9775 with :
98- toolchain : stable
99- profile : minimal
100- override : true
101-
102- - name : Build
103- uses : actions-rs/cargo@v1
104- with :
105- command : build
106- args : --examples --all
107-
108- - name : Test
109- uses : actions-rs/cargo@v1
76+ toolchain : ${{ env.nightly }}
77+ - name : Install sccache
78+ uses : mozilla-actions/sccache-action@v0.0.9
79+
80+ - name : Build libraries
81+ run : cargo build --workspace --exclude vise-e2e-tests --lib --all-features
82+
83+ - name : Build docs
84+ run : |
85+ cargo clean --doc && \
86+ cargo rustdoc -p matterdb-derive --all-features -- -D warnings --cfg docsrs && \
87+ cargo rustdoc -p matterdb --all-features -- -D warnings --cfg docsrs
88+
89+ - name : Deploy
90+ uses : JamesIves/github-pages-deploy-action@v4
91+ if : github.event_name == 'push' && github.ref_type == 'branch'
11092 with :
111- command : test
112- args : --all
93+ branch : gh-pages
94+ folder : target/doc
95+ single-commit : true
0 commit comments