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
name: CI
on:
push:
branches:
pull_request:
branches:
release:
types:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Use Rust stable
run: rustup update stable && rustup default stable
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --all-features
- name: Check documentation
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps
- name: Verify package
run: cargo package
- name: Build project
run: cargo build --release
- name: Publish (on tag)
if: github.ref_type == 'tag'
run: cargo publish --verbose
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}