-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (51 loc) · 1.69 KB
/
ci.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
name: CI
on:
push:
branches: [ master, 'polkadot-v[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
cancel_previous_runs:
name: Cancel Previous Runs
runs-on: ubuntu-20.04
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
check:
name: Rust check ${{ matrix.check }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
check: [ cargo build --release,
cargo test --all --features runtime-benchmarks --features try-runtime,
cargo +nightly-2024-04-14 fmt --all -- --check,
cargo clippy --all-features -- -D warnings
]
steps:
- uses: actions/checkout@v3
- name: Install protoc
run: sudo apt-get install protobuf-compiler
- name: Install nightly toolchain
# align nightly version with https://github.com/polkadot-fellows/runtimes/blob/7157d41176bebf128aa2e29e72ed184844446b19/.github/env#L2C22-L2C32
run: rustup toolchain install nightly-2024-04-14 --profile minimal --component rustfmt
- name: Setup Rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.rust-target }}-${{ matrix.check }}
- name: ${{ matrix.check }}
run: ${{ matrix.check }}
cargo-toml-fmt:
runs-on: ubuntu-latest
container: "tamasfe/taplo:0.7.0-alpine"
steps:
- uses: actions/checkout@v3
- name: Run Taplo fmt
run: taplo fmt --check
- name: Fail-fast; cancel other jobs
if: failure()
uses: andymckay/[email protected]