-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (120 loc) · 3.69 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI
on:
pull_request:
types: [labeled]
push:
branches: [develop, main]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
check-files:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check-files.outputs.skip }}
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c #v44.5.7
id: changed-files
with:
files: |
**/*.rs
**/Cargo.toml
**/*.scale
- name: Check if proper files changed
id: check-files
run: |
if [[ "${{ steps.changed-files.outputs.any_changed }}" == "false" ]]; then
echo "No files changed. Skipping CI."
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "Some files changed. Running CI."
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: "0.4.40"
- name: Build the book
run: mdbook build docs
toml:
if: ${{ needs.check-files.outputs.skip == 'false' && ((github.event.label.name == 'ready for review') || (github.ref_name == 'develop') || (github.ref_name == 'master')) }}
runs-on: self-hosted
needs: check-files
steps:
- uses: actions/checkout@v4
- name: List versions
run: |
cargo --version
taplo --version
- name: Run taplo
run: |
taplo lint
taplo fmt --check
format:
runs-on: self-hosted
needs: toml
steps:
- uses: actions/checkout@v4
- name: List version
run: |
cargo +nightly --version
cargo +nightly fmt --version
- name: Cargo format
run: cargo +nightly fmt --all -- --check
clippy_build_and_test:
runs-on: self-hosted
needs:
- format
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- name: List version
run: |
rustup show
cargo --version
cargo clippy --version
cargo tarpaulin --version
- name: Build in dev mode
run: cargo build --profile ci --locked
- name: Cargo clippy
run: cargo clippy --profile ci --locked
- name: Run tests
run: cargo tarpaulin --profile ci --locked --workspace --skip-clean --exclude maat
benchmarks:
runs-on: self-hosted
needs:
- clippy_build_and_test
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- name: pallet-proofs — Run test benchmarks
run: cargo test --profile ci --locked -p pallet-proofs --features runtime-benchmarks -- benchmark --nocapture
- name: pallet-proofs — Run node benchmarks
run: cargo run \
-p polka-storage-node -r -F runtime-benchmarks -- \
benchmark pallet \
--wasm-execution=compiled \
--pallet "pallet_proofs"\
--extrinsic "*" \
--steps 5 \
--repeat 1 \
--template node/benchmark_template.hbs
- name: pallet-randomness — Run test benchmarks
run: cargo test --profile ci --locked -p pallet-randomness --features runtime-benchmarks -- benchmark --nocapture
- name: pallet-randomness — Run node benchmarks
run: cargo run \
-p polka-storage-node -r -F runtime-benchmarks -- \
benchmark pallet \
--wasm-execution=compiled \
--pallet "pallet_randomness"\
--extrinsic "*" \
--steps 5 \
--repeat 1 \
--template node/benchmark_template.hbs