-
Notifications
You must be signed in to change notification settings - Fork 12
61 lines (59 loc) · 1.66 KB
/
build.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
name: Build
on:
push:
branches:
- master
paths:
- "**.rs"
- "**.toml"
- "**.lock"
- ".github/workflows/*.yml"
pull_request:
branches:
- master
paths:
- "**.rs"
- "**.toml"
- "**.lock"
- ".github/workflows/*.yml"
jobs:
format-build-test:
runs-on: ubicloud
timeout-minutes: 15
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Config rust toolchain
run: |
rustup update stable && rustup default stable
rustup show active-toolchain
- name: Format
run: cargo fmt --all -- --check
- name: install libdrift_ffi_sys
run: |
curl -L https://github.com/drift-labs/drift-ffi-sys/releases/download/v2.103.0/libdrift_ffi_sys.so.zip > ffi.zip && unzip ffi.zip
sudo cp libdrift_ffi_sys.so /lib/
- uses: ubicloud/rust-cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: |
cargo -V
cargo check
- name: Test
env:
DRIFT_GATEWAY_KEY: ${{ secrets.DRIFT_GATEWAY_KEY }}
TEST_DELEGATED_SIGNER: ${{ secrets.TEST_DELEGATED_SIGNER }}
TEST_RPC_ENDPOINT: ${{ secrets.DEVNET_RPC_ENDPOINT }}
# --test-threads, limit parallelism to prevent hitting RPC rate-limits
run: |
cargo -V
cp libdrift_ffi_sys.so ./target/debug/deps
cargo test --all -- --test-threads=2