-
Notifications
You must be signed in to change notification settings - Fork 17
67 lines (56 loc) · 1.55 KB
/
rust.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Rust
permissions:
pull-requests: write
contents: write
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
defaults:
run:
working-directory: ./crate
jobs:
clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --benches -- -D clippy::all
cargo-fmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --check
# there're sometimes warnings, which signal, that the generated doc
# won't look as expected, when rendered, and sometimes errors, which will prevent doc from being
# generated at release time altogether.
cargo-doc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: run cargo doc
run: RUSTDOCFLAGS="-D warnings" cargo doc
release-plz:
runs-on: ubuntu-latest
needs: [clippy, cargo-fmt, cargo-doc]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.MY_GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: MarcoIeni/[email protected]
env:
# https://release-plz.ieni.dev/docs/github/trigger
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}