-
Notifications
You must be signed in to change notification settings - Fork 3
240 lines (212 loc) · 7.01 KB
/
ci-check-app.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: App - Check
on:
workflow_call:
inputs:
test-args:
description: 'The arguments to pass to the test command'
type: string
default: '--all-features --lib --bins'
test-suites:
description: 'Extra test suites to run'
type: string
default: ''
rust-toolchain:
description: 'The Rust version to use'
type: string
default: 'stable'
rust-toolchain-formatting:
description: 'The Rust version to use to check formatting'
type: string
default: 'stable'
rust-toolchain-udeps:
description: 'The Rust version to use to run udeps'
type: string
default: 'nightly'
check-udeps:
description: Enable checking for unusued dependencies
type: boolean
default: true
rust-backtrace:
description: 'The Rust backtrace settings'
type: string
default: 'full'
install-protoc:
description: 'Install protoc before running tests'
type: boolean
default: true
use-sccache:
description: 'Run sccache-cache before running tests'
type: boolean
default: true
use-postgresql:
description: 'Run postgresql before running tests'
type: boolean
default: false
test-env-vars:
description: 'The environment variables to set for the tests'
type: string
default: ''
run-label:
description: 'The run label to use for the actions'
type: string
default: 'ubuntu-latest'
env:
RUST_BACKTRACE: ${{ inputs.rust-backtrace }}
permissions:
contents: read
jobs:
clippy:
name: Clippy
runs-on: ${{ inputs.run-label }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
submodules: recursive
- name: Install Rust ${{ inputs.rust-toolchain }}
uses: WalletConnect/actions-rs/[email protected]
with:
toolchain: ${{ inputs.rust-toolchain }}
profile: 'minimal'
components: 'cargo,clippy'
override: true
- name: Install Protoc
if: ${{ inputs.install-protoc == true }}
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run sccache-cache
if: ${{ inputs.use-sccache == true }}
uses: mozilla-actions/[email protected]
- name: Clippy
uses: WalletConnect/actions-rs/[email protected]
with:
command: clippy
args: --workspace --all-features --all-targets -- -D warnings
formatting:
name: Formatting
runs-on: ${{ inputs.run-label }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
submodules: recursive
- name: Install Rust ${{ inputs.rust-toolchain-formatting }}
uses: WalletConnect/actions-rs/[email protected]
with:
toolchain: ${{ inputs.rust-toolchain-formatting }}
profile: 'default'
override: true
- name: Run sccache-cache
if: ${{ inputs.use-sccache == true }}
uses: mozilla-actions/[email protected]
- name: Check Formatting
uses: WalletConnect/actions-rs/[email protected]
with:
command: fmt
args: -- --check
tests:
name: Unit Tests
runs-on: ${{ inputs.run-label }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
submodules: recursive
- name: Install Rust ${{ inputs.rust-toolchain }}
uses: WalletConnect/actions-rs/[email protected]
with:
toolchain: ${{ inputs.rust-toolchain }}
profile: 'default'
override: true
- name: Install Protoc
if: ${{ inputs.install-protoc == true }}
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run sccache-cache
if: ${{ inputs.use-sccache == true }}
uses: mozilla-actions/[email protected]
- name: Unit Tests
uses: WalletConnect/actions-rs/[email protected]
with:
command: test
args: ${{ inputs.test-args }}
tests-suites:
name: Tests Suite "${{ matrix.element }}"
if: (inputs.test-suites != '') && (inputs.test-suites != '[]')
strategy:
fail-fast: false
matrix:
element: ${{ fromJson(inputs.test-suites) }}
runs-on: ${{ inputs.run-label }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
submodules: recursive
- name: Parse and export environment variables
run: |
echo '${{ inputs.test-env-vars }}' | jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" >> $GITHUB_ENV
- name: Run Postgresql
if: ${{ inputs.use-postgresql == true }}
uses: ikalnytskyi/action-setup-postgres@v5
- name: Install Rust ${{ inputs.rust-toolchain }}
uses: WalletConnect/actions-rs/[email protected]
with:
toolchain: ${{ inputs.rust-toolchain }}
profile: 'default'
override: true
- name: Install Protoc
if: ${{ inputs.install-protoc == true }}
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run sccache-cache
if: ${{ inputs.use-sccache == true }}
uses: mozilla-actions/[email protected]
- name: Test Suite
uses: WalletConnect/actions-rs/[email protected]
with:
command: test
args: --test ${{ matrix.element }}
unused-dependencies:
name: Unused Dependencies
runs-on: ${{ inputs.run-label }}
if: ${{ inputs.check-udeps }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
submodules: recursive
- name: Install Rust ${{ inputs.rust-toolchain-udeps }}
uses: WalletConnect/actions-rs/[email protected]
with:
toolchain: ${{ inputs.rust-toolchain-udeps }}
profile: 'default'
override: true
- name: Run sccache-cache
if: ${{ inputs.use-sccache == true }}
uses: mozilla-actions/[email protected]
- name: Check Dependencies
uses: WalletConnect/actions-rs/[email protected]
with:
version: 'v0.1.43'
args: '--all-targets'
license:
name: Licenses
runs-on: ${{ inputs.run-label }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
submodules: recursive
- uses: EmbarkStudios/cargo-deny-action@v1
with:
rust-version: ${{ inputs.rust-toolchain }}
command: check license