-
Notifications
You must be signed in to change notification settings - Fork 538
157 lines (128 loc) · 4.53 KB
/
default.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Lint and Features check
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch:
env:
CARGO_SCCACHE_COMMIT: bed5571c
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup show
- name: Check code formatting
run: cargo fmt --check
- name: Check E2E code formatting
run: cargo fmt --manifest-path e2e/Cargo.toml --check
- name: Check Avail-SubXt code formatting
run: cargo fmt --manifest-path avail-subxt/Cargo.toml --check
- name: Install zepter
run: cargo install zepter --locked --version 0.11.0 -q -f --no-default-features && zepter --version
- name: Check toml formatting
run: zepter format features
- name: Check e2e toml formatting
run: zepter format features --manifest-path e2e/Cargo.toml
- name: Check Avail-SubXt toml formatting
run: zepter format features --manifest-path avail-subxt/Cargo.toml
build:
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cache/
~/.cargo/bin/sccache*
key: ${{ runner.OS }}-sccache-bin-${{ env.CARGO_SCCACHE_COMMIT }}-v1
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-dev valgrind git clang curl libssl-dev protobuf-compiler unzip python3-pip
- name: Setup Rust toolchain
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup show
- name: Set PATH for cargo
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "SCCACHE_DIR=${HOME}/.cache/sccache" >> $GITHUB_ENV
- name: SCCache
run: |
# We altered the path to avoid old actions to overwrite it
if [ ! -f ~/.cargo/bin/sccache ]; then
cargo install sccache \
--git https://github.com/purestake/sccache.git \
--rev $CARGO_SCCACHE_COMMIT \
--force --no-default-features --features=dist-client
fi
if [[ -z `pgrep sccache` ]]; then
chmod +x ~/.cargo/bin/sccache
sccache --start-server
fi
sccache -s
echo "RUSTC_WRAPPER=${HOME}/.cargo/bin/sccache" >> $GITHUB_ENV
- name: Build node
run: cargo build --release -p avail-node
- name: Upload avail-node binary
uses: actions/upload-artifact@v4
with:
name: avail-node
path: target/release/avail-node
- name: Display SCCache Stats
run: sccache --show-stats
check_features:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v3
with:
path: |
~/.cache/
~/.cargo/bin/sccache*
key: ${{ runner.OS }}-cache-bin-${{ env.CARGO_SCCACHE_COMMIT }}-v1
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-dev valgrind git clang curl libssl-dev protobuf-compiler unzip python3-pip
- name: Setup Rust toolchain
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup show
- name: Set PATH for cargo
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "SCCACHE_DIR=${HOME}/.cache/sccache" >> $GITHUB_ENV
- name: SCCache
run: |
# We altered the path to avoid old actions to overwrite it
if [ ! -f ~/.cargo/bin/sccache ]; then
cargo install sccache \
--git https://github.com/purestake/sccache.git \
--rev $CARGO_SCCACHE_COMMIT \
--force --no-default-features --features=dist-client
fi
if [[ -z `pgrep sccache` ]]; then
chmod +x ~/.cargo/bin/sccache
sccache --start-server
fi
sccache -s
echo "RUSTC_WRAPPER=${HOME}/.cargo/bin/sccache" >> $GITHUB_ENV
- name: Check other features
env:
SKIP_WASM_BUILD: true
run: cargo check --release --workspace --features "runtime-benchmarks try-runtime" -p avail-node