-
Notifications
You must be signed in to change notification settings - Fork 16
116 lines (94 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
116 lines (94 loc) · 2.95 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
name: Tests
on:
push:
workflow_dispatch:
jobs:
contracts:
name: Contracts
runs-on: ubuntu-latest
env:
FOUNDRY_PROFILE: ci
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
cache: true
- name: Show Foundry version
run: forge --version
- name: Install Bun
uses: oven-sh/setup-bun@v1
- name: Show Bun version
run: bun --version
working-directory: ./contracts
- name: Install Solhint
run: bun install solhint
working-directory: ./contracts
- name: Run Solhint in `src`
run: bunx --bun solhint --config .solhint.json 'src/**/*.sol'
working-directory: ./contracts
id: solhint-src
- name: Run Solhint in `test` dir
run: bunx --bun solhint --config .solhint.other.json 'test/**/*.sol'
working-directory: ./contracts
id: solhint-test
- name: Run Solhint in `script` dir
run: bunx --bun solhint --config .solhint.other.json 'script/**/*.sol'
working-directory: ./contracts
id: solhint-script
- name: Run Forge build
run: forge build --sizes --ast
working-directory: ./contracts
- name: Run Forge tests
run: forge test -vvv --gas-report
env:
API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }}
API_KEY_ALCHEMY: ${{ secrets.API_KEY_ALCHEMY }}
working-directory: ./contracts
- name: Upload Contract Artifacts
uses: actions/upload-artifact@v4
with:
name: contract-artifacts
path: ./contracts/out
bindings:
name: Bindings
runs-on: ubuntu-latest
needs: contracts
env:
PROTOCOL_ADAPTER_ADDRESS_SEPOLIA: ${{ vars.PROTOCOL_ADAPTER_ADDRESS_SEPOLIA }}
API_KEY_INFURA: ${{ secrets.API_KEY_INFURA }}
API_KEY_ALCHEMY: ${{ secrets.API_KEY_ALCHEMY }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Contract Artifacts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: ./contracts/out
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Show Rust version
run: rustc --version
- name: Cache Rust toolchain and dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
./bindings/target
key: rust-build-${{ hashFiles('bindings/Cargo.toml') }}
restore-keys: |
rust-build-
- name: Build Bindings
run: cargo build --release
working-directory: ./bindings
- name: Run Tests
run: cargo test --verbose
working-directory: ./bindings