-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (112 loc) · 3.26 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
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: rust-validation-${{ github.head_ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: full
RUST_LOG: "gadget=trace"
CARGO_TERM_COLOR: always
jobs:
formatting:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Check Formatting
run: cargo fmt -- --check
linting:
timeout-minutes: 120
name: cargo clippy
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Verify Forge installation
run: forge --version
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: install protobuf and gmp
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler libprotobuf-dev libgmp-dev
- name: Run Clippy
run: cargo clippy --tests --examples -- -D warnings
testing:
timeout-minutes: 30
name: cargo test
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
strategy:
fail-fast: false
matrix:
package:
[
# Macros
gadget-blueprint-proc-macro,
gadget-blueprint-proc-macro-core,
gadget-context-derive,
# Clients
gadget-client-eigenlayer,
gadget-client-evm,
gadget-client-tangle,
# Crypto
gadget-crypto-sp-core,
gadget-crypto-ed25519,
gadget-crypto-bls,
gadget-crypto-k256,
gadget-crypto-sr25519,
# Event listeners
gadget-event-listeners-core,
gadget-event-listeners-evm,
gadget-event-listeners-cronjob,
gadget-event-listeners-tangle,
gadget-blueprint-serde,
gadget-config,
gadget-executor,
gadget-keystore,
gadget-std,
gadget-utils-tangle,
gadget-networking,
]
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: stable
- uses: swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: install protobuf and gmp
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler libprotobuf-dev libgmp-dev
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: tests
run: cargo nextest run --profile ci --package ${{ matrix.package }}
# TODO: nextest doesn't support doc tests yet (https://github.com/nextest-rs/nextest/issues/16)
- name: doc tests
run: cargo test --package ${{ matrix.package }} --doc ${{ matrix.package == 'gadget-networking' && '-- --test-threads=1' || '' }}