-
Notifications
You must be signed in to change notification settings - Fork 70
104 lines (90 loc) · 3.04 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Rust
permissions:
pull-requests: write
contents: write
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
jobs:
tests:
strategy:
matrix:
rust_version: [1.67.0, stable]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust_version }}
- name: set default rust toolchain
run: rustup default ${{ matrix.rust_version }}
- name: print rustc version
run: rustc --version
# - name: downgrade `toml_edit`, time`, `toml_datetime` crate to support older Rust toolchain
# if: matrix.rust_version == '1.67.0'
# run: |
# cargo update -p toml_edit --precise 0.21.0
- name: Run tests
run: ./.github/test.sh
# remove this job when https://github.com/rust-lang/rust/issues/89554 stabilizes
test_exhaustive_checks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install nightly for exhaustive check tests
uses: dtolnay/rust-toolchain@nightly
# a failure on this check means, that some of `syn` crate's enums have been extended
# with new variants.
# consult https://github.com/serde-rs/serde/blob/master/serde_derive/src/bound.rs#L100 ,
# the implementation of `FindTyParams` may have been updated already
- name: Run exhaustive check tests
run: RUSTFLAGS="-A unused_imports -D warnings" cargo check --workspace --features force_exhaustive_checks
clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --features unstable__schema --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 --features derive,unstable__schema
release-plz:
runs-on: ubuntu-latest
needs: [tests, clippy, cargo-fmt]
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: MarcoIeni/[email protected]
env:
# https://marcoieni.github.io/release-plz/github-action.html#triggering-further-workflow-runs
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}