forked from build-trust/ockam
-
Notifications
You must be signed in to change notification settings - Fork 0
273 lines (258 loc) · 9.63 KB
/
Copy pathrust.yml
File metadata and controls
273 lines (258 loc) · 9.63 KB
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: Rust
permissions:
contents: read
on:
workflow_dispatch:
inputs:
commit_sha:
description: SHA to test workflow
merge_group:
branches: [develop]
pull_request:
paths:
- ".github/workflows/rust.yml"
- "**.rs"
- "**.toml"
- "**/Cargo.lock"
- "**.gradle"
- "tools/gradle/**"
- "gradlew"
- "gradlew.bat"
- ".github/actions/**"
# This is a temporary fix.
# To allow merge queue to merge PRs, we need Rust and Elixir
# workflows to pass successfully. This PR ensures we also
# run Rust workflows on update to Elixir code.
- '**.ex'
- '**.exs'
- '**/mix.lock'
push:
paths:
- ".github/workflows/rust.yml"
- "**.rs"
- "**.toml"
- "**/Cargo.lock"
- "**.gradle"
- "tools/gradle/**"
- "gradlew"
- "gradlew.bat"
- ".github/actions/**"
# This is a temporary fix.
# To allow merge queue to merge PRs, we need Rust and Elixir
# workflows to pass successfully. This PR ensures we also
# run Rust workflows on update to Elixir code.
- '**.ex'
- '**.exs'
- '**/mix.lock'
branches:
- develop
schedule:
- cron: "0 1 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
lint_cargo_fmt_check:
name: Rust - Lint Formatting
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew lint_cargo_fmt_check
lint_cargo_clippy:
name: Rust - Lint with Cargo Clippy
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew lint_cargo_clippy
- uses: ./.github/actions/cargo_target_dir_pre_cache
lint_cargo_deny:
name: Rust - Lint with Cargo Deny
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew lint_cargo_deny
build_docs:
name: Rust - Build Documentation
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew build_docs
- uses: ./.github/actions/cargo_target_dir_pre_cache
build:
name: Rust - Build
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew build
- uses: ./.github/actions/cargo_target_dir_pre_cache
build_examples:
name: Rust - Build Examples
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew build_examples
- uses: ./.github/actions/cargo_target_dir_pre_cache
test:
name: Rust - Test
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
services:
ockam_cloud:
image: ghcr.io/build-trust/ockam-cloud-node@sha256:518314876a5b07c263b88995792335c4426d940c10e5e638a60e66776d86cff5
env:
CLOUD_ADDRESS: ockam_cloud:4000
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew test
- uses: ./.github/actions/cargo_target_dir_pre_cache
check_no_std:
name: Rust - Check Features - no_std alloc software_vault
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
rustup target add thumbv7em-none-eabihf
cd implementations/rust/ockam/ockam
RUSTFLAGS='-Dwarnings' cargo check --target thumbv7em-none-eabihf --no-default-features --features 'no_std alloc software_vault'
- uses: ./.github/actions/cargo_target_dir_pre_cache
check_cargo_update:
name: Rust - Check Cargo Update
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd examples/rust/get_started
rm -rf Cargo.lock
cargo update
RUSTFLAGS='--cfg tokio_unstable -Dwarnings' cargo check
- uses: ./.github/actions/cargo_target_dir_pre_cache
check_nightly:
name: Rust - Nightly Check
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- run: rustup default nightly
- run: rustup update nightly
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
RUSTFLAGS='--cfg tokio_unstable -Dwarnings' cargo check
- uses: ./.github/actions/cargo_target_dir_pre_cache
build_nightly:
name: Rust - Nightly Build
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- run: rustup default nightly
- run: rustup update nightly
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew build
- uses: ./.github/actions/cargo_target_dir_pre_cache
test_nightly:
name: Rust - Nightly Test
runs-on: ubuntu-20.04
container:
image: ghcr.io/build-trust/ockam-builder@sha256:26c5bba9deca18953043a3a2368ec6bb00035676965432f35be24f88e316363a
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
ref: ${{ github.event.inputs.commit_sha }}
- run: rustup default nightly
- run: rustup update nightly
- uses: ./.github/actions/gradle_cache
- uses: ./.github/actions/cargo_home_cache
- uses: ./.github/actions/cargo_target_dir_cache
- run: |
rustc --version
cd implementations/rust && ../../gradlew test
env:
NIGHTLY_CI: 1
- uses: ./.github/actions/cargo_target_dir_pre_cache