-
Notifications
You must be signed in to change notification settings - Fork 9
177 lines (169 loc) · 4.91 KB
/
rust.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
name: Rust
on:
push:
branches: main
paths:
- code/**
- specs/quint/**
- .github/workflows/rust.yml
pull_request:
paths:
- code/**
- specs/quint/**
- .github/workflows/rust.yml
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_RELEASE_DEBUG: 1
RUST_BACKTRACE: short
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Quint
run: npm install -g @informalsystems/quint
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-workspaces: "code"
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Run tests
run: |
cargo nextest run \
--workspace \
--all-features \
--no-fail-fast \
--failure-output final \
--exclude informalsystems-malachitebft-starknet-test \
--exclude informalsystems-malachitebft-discovery-test
integration:
name: Integration Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Quint
run: npm install -g @informalsystems/quint
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-workspaces: "code"
- name: Install cargo-maelstrom
uses: taiki-e/install-action@v2
with:
tool: cargo-maelstrom
- name: Disable apparmor container restrictions
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Run integration tests
run: |
cargo maelstrom \
--slots 16 \
--include 'package.match(informalsystems-malachitebft-starknet-test) || package.match(informalsystems-malachitebft-discovery-test)'
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-workspaces: "code"
- name: Run clippy
uses: actions-rs/clippy@master
with:
token: ${{secrets.GITHUB_TOKEN}}
args: --all-features --all-targets --manifest-path code/Cargo.toml
fmt:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
cache-workspaces: "code"
- name: Check formatting
uses: actions-rust-lang/rustfmt@v1
with:
manifest-path: code/Cargo.toml
msrv:
name: MSRV
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
cache-workspaces: "code"
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-msrv
uses: taiki-e/install-action@v2
with:
tool: cargo-msrv
- name: Check MSRV
run: cargo msrv verify --manifest-path crates/engine/Cargo.toml --output-format minimal -- cargo check --all-features
standalone:
name: Standalone
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
cache-workspaces: "code"
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Check each crate with and without default features
run: cargo hack check --workspace --each-feature --no-dev-deps