-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 1.82 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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
DATABASE_URL: ${{ secrets.DATABASE_URL }}
jobs:
build-fmt-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install risczero toolchain
run: |
curl -L https://risczero.com/install | bash
export PATH="$HOME/.risc0/bin:$PATH"
rzup install
rzup install cpp
echo "$HOME/.risc0/bin" >> $GITHUB_PATH
- name: Add DATABASE_URL environment variable
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: echo "DATABASE_URL is set"
- name: Build
run: cargo build --verbose
- name: Run tests
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: cargo test --verbose
- name: Run format check
run: cargo fmt --check
- name: Run Clippy
run: >
cargo clippy
-p common
-p ethereum
-p guest-types
-p mmr-utils
-p relayer
-p starknet-handler
--
-D warnings
-W clippy::single_match
-W clippy::single_match_else
-W clippy::needless_match
-W clippy::needless_late_init
-W clippy::redundant_pattern_matching
-W clippy::redundant_pattern
-W clippy::redundant_guards
-W clippy::collapsible_match
-W clippy::match_single_binding
-W clippy::match_same_arms
-W clippy::match_ref_pats
-W clippy::match_bool
-D clippy::needless_bool
-W clippy::unwrap_used
-W clippy::expect_used