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
41
42
43
44
45
46
47
48
name: CI
on:
push:
branches:
pull_request:
# Tags run these through release.yml, which publishes only once they pass.
workflow_call:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Referenced by branch: this action publishes no release tags.
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
# Both feature sets: Avatar::to_png and its imports exist only with `png`.
- run: cargo clippy --all-targets --locked -- -D warnings
- run: cargo clippy --all-targets --all-features --locked -- -D warnings
- run: cargo test --locked
- run: cargo test --all-features --locked
- run: cargo doc --no-deps --all-features --locked
env:
RUSTDOCFLAGS: -D warnings
# Builds the crate as crates.io would get it, so a release cannot fail on packaging.
- run: cargo publish --dry-run --locked
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# The rust-version promised in Cargo.toml.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.91"
- uses: Swatinem/rust-cache@v2
- run: cargo build --all-targets --all-features --locked