@@ -3,17 +3,7 @@ name: CI
33on :
44 push :
55 branches : ['**']
6- paths :
7- - ' **.rs'
8- - ' **/Cargo.toml'
9- - ' **/Cargo.lock'
10- - ' .github/workflows/ci.yml'
11- pull_request :
12- paths :
13- - ' **.rs'
14- - ' **/Cargo.toml'
15- - ' **/Cargo.lock'
16- - ' .github/workflows/ci.yml'
6+ pull_request : {}
177
188env :
199 CARGO_TERM_COLOR : always
2717 - uses : actions/checkout@v5
2818
2919 - name : Install Rust
30- uses : dtolnay/rust-toolchain@stable
20+ uses : dtolnay/rust-toolchain@nightly
3121 with :
3222 components : clippy
3323
6353 steps :
6454 - uses : actions/checkout@v5
6555
66- - name : Install Rust
56+ - name : Install Rust (nightly + llvm-tools)
6757 uses : dtolnay/rust-toolchain@nightly
6858 with :
6959 components : llvm-tools-preview
@@ -105,14 +95,44 @@ jobs:
10595 fail_ci_if_error : false
10696 token : ${{ secrets.CODECOV_TOKEN }}
10797
98+ docs :
99+ name : Documentation
100+ runs-on : ubuntu-latest
101+ steps :
102+ - uses : actions/checkout@v5
103+
104+ - name : Install Rust (nightly)
105+ uses : dtolnay/rust-toolchain@nightly
106+
107+ - name : Cache cargo registry
108+ uses : actions/cache@v4
109+ with :
110+ path : ~/.cargo/registry
111+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
112+
113+ - name : Cache cargo index
114+ uses : actions/cache@v4
115+ with :
116+ path : ~/.cargo/git
117+ key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
118+
119+ - name : Cache cargo build
120+ uses : actions/cache@v4
121+ with :
122+ path : target
123+ key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
124+
125+ - name : Build docs
126+ run : cargo doc --workspace --all-features --no-deps
127+
108128 examples :
109129 name : Examples
110130 runs-on : ubuntu-latest
111131 steps :
112132 - uses : actions/checkout@v5
113133
114- - name : Install Rust
115- uses : dtolnay/rust-toolchain@stable
134+ - name : Install Rust (nightly)
135+ uses : dtolnay/rust-toolchain@nightly
116136
117137 - name : Cache cargo registry
118138 uses : actions/cache@v4
@@ -146,22 +166,23 @@ jobs:
146166 release :
147167 name : Semantic Release
148168 runs-on : ubuntu-latest
149- needs : [clippy, test, examples]
150- if : github.ref == 'refs/heads/main ' && github.event_name == 'push '
169+ needs : [clippy, test, docs, examples]
170+ if : github.event_name == 'push ' && github.ref == 'refs/heads/main '
151171 environment : main
152172 permissions :
153173 contents : write
154174 issues : write
155175 pull-requests : write
156176 id-token : write
177+
157178 steps :
158179 - uses : actions/checkout@v5
159180 with :
160181 fetch-depth : 0
161182 persist-credentials : false
162183
163- - name : Install Rust
164- uses : dtolnay/rust-toolchain@stable
184+ - name : Install Rust (nightly)
185+ uses : dtolnay/rust-toolchain@nightly
165186
166187 - name : Cache cargo registry
167188 uses : actions/cache@v4
@@ -181,9 +202,6 @@ jobs:
181202 path : target
182203 key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
183204
184- - name : Build package
185- run : cargo build --release --all-features
186-
187205 - name : Setup Node.js
188206 uses : actions/setup-node@v6
189207 with :
@@ -195,22 +213,14 @@ jobs:
195213 semantic-release@latest \
196214 @semantic-release/git@latest \
197215 @semantic-release/changelog@latest \
198- @semantic-release/exec@latest \
216+ @semantic-release/commit-analyzer@latest \
217+ @semantic-release/release-notes-generator@latest \
218+ @semantic-release/github@latest \
199219 @semantic-release-cargo/semantic-release-cargo \
200220 conventional-changelog-conventionalcommits@latest
201221
202222 - name : Semantic Release
203- id : semantic
204223 env :
205224 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
206225 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_TOKEN }}
207- run : |
208- npx semantic-release
209- echo "new_release_published=$([ -f .semanticRelease ])" >> $GITHUB_OUTPUT
210-
211- - name : Publish to crates.io
212- if : always()
213- run : |
214- cargo publish --token ${{ secrets.CARGO_TOKEN }} --allow-dirty || true
215- env :
216- CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_TOKEN }}
226+ run : npx semantic-release
0 commit comments