-
Notifications
You must be signed in to change notification settings - Fork 27
191 lines (153 loc) · 4.42 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: ci
on:
push:
branches: [ "main" ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
env:
CARGO_TERM_COLOR: always
GITHUB_ACTOR: pop-cli
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true
- name: Check formatting
run: cargo +nightly fmt --all -- --check
build:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Check Feature Contracts Excl.
run: cargo check --no-default-features --features contract
- name: Check Features Parachain Excl.
run: cargo check --no-default-features --features parachain
- name: Build default features
run: cargo build
clippy:
needs: lint
runs-on: ubuntu-latest
permissions:
checks: write
env:
RUSTFLAGS: "-Wmissing_docs"
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Annotate with Clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/build-push-action@v5
unit-tests:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Run unit tests
run: cargo test --lib --bins
coverage:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lib --bins --codecov --output-path codecov.json
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
documentation-tests:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Run doc tests
run: cargo test --doc
contract-integration-tests:
needs: lint
strategy:
matrix:
os: [ "ubuntu-latest", "macos-latest" ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
default: true
target: wasm32-unknown-unknown
components: rust-src, clippy
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Run integration tests
run: cargo test --no-default-features --features contract --test contract
parachain-integration-tests:
needs: lint
strategy:
matrix:
os: [ "ubuntu-latest", "macos-latest" ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
default: true
target: wasm32-unknown-unknown
components: rust-src, clippy
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Install packages (Linux)
if: matrix.os == 'ubuntu-latest'
uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Install packages (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install protobuf
protoc --version
- name: Run integration tests
run: cargo test --no-default-features --features parachain --test parachain