forked from Aperture-Finance/Aperture-Lens
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (84 loc) · 2.32 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
name: Rust
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: Install dependencies 📦
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Generate contract Rust bindings
run: yarn bind
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Install Rust toolchain via rustup
run:
rustup component add clippy
- name: Check linting
run: cargo clippy --all-targets --all-features -- -D warnings
test:
needs: lint
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: Install dependencies 📦
run: yarn install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Generate contract Rust bindings
run: yarn bind
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Build
run: cargo build
- name: Run tests
run: cargo test --lib -- --test-threads=1