-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (95 loc) · 3.06 KB
/
ci.yaml
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
name: CI
on:
pull_request:
types: [ labeled ]
push:
branches: [ develop, main ]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# toml:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# - name: Install taplo
# run: cargo install taplo-cli --locked
# - name: List versions
# run: |
# cargo --version
# taplo --version
# - name: Run taplo
# run: taplo format --check --diff
# - name: Taplo failure info
# if: failure()
# run: |
# echo 'TOML is not formatted correctly'
# echo 'Please run taplo format'
#
# format:
# runs-on: self-hosted
# needs: toml
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# with:
# toolchain: nightly
# components: rustfmt
# - name: List version
# run: |
# cargo --version
# cargo fmt --version
# - name: Cargo format
# run: cargo fmt --all -- --check
# - name: Cargo fmt failure info
# if: failure()
# run: |
# echo '.rs files are not formatted correctly'
# echo 'Please run cargo fmt --all'
clippy_build_and_test:
runs-on: self-hosted
# needs:
# - format
steps:
- uses: actions/checkout@v4
- name: Cargo caching
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.77.0
target: wasm32-unknown-unknown
components: clippy rust-src
- name: List version
run: |
rustup show
cargo --version
cargo clippy --version
- name: Build in dev mode
run: cargo build --profile ci
- name: Cargo clippy
run: |
RUSTFLAGS="-C opt-level=0 -C debug-assertions=off -C overflow-checks=off -C lto=off -C panic=abort -C incremental=off -C codegen-units=256" cargo clippy
#
# - name: Build with try-runtime feature
# run: RUSTFLAGS="-D warnings" cargo build --locked --features try-runtime
# - name: Build node runtime
# run: RUSTFLAGS="-D warnings" cargo build --locked -p polka-storage-runtime
# - name: Build node with runtime-benchmark feature
# run: RUSTFLAGS="-D warnings" cargo build --locked -p polka-storage-node --features runtime-benchmarks
# - name: Run tests
# run: RUSTFLAGS="-D warnings" cargo test --locked --workspace
# - name: Build in release mode
# # Run only on merge to the protected branches
# if: |
# contains(github.ref, 'develop') ||
# contains(github.ref, 'main')
# run: RUSTFLAGS="-D warnings" cargo build --locked --release