-
Notifications
You must be signed in to change notification settings - Fork 15
155 lines (153 loc) · 5.36 KB
/
test.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
name: Test project
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
solana_version: '1.18.17'
anchor_version: '0.30.1'
jobs:
install:
runs-on: ubuntu-latest
strategy:
matrix:
case: [
'npm run test:swap',
'npm run test:multiple-swap',
'npm run test:cross',
'npm run test:cross-both-side',
'npm run test:liquidity-gap',
'npm run test:simulate-swap',
'npm run test:reversed',
'npm run test:position',
'npm run test:math',
'npm run test:withdraw',
# 'npm run test:withdraw-staker',
'npm run test:position-list',
'npm run test:claim',
'npm run test:random',
'npm run test:simulate-claim-amount',
# 'npm run test:math-staker',
'npm run test:cu',
'npm run test:init-both',
'npm run test:change-protocol-fee',
'npm run test:tickmap',
'npm run test:change-fee-receiver',
'npm run test:whole-liquidity',
# 'npm run test:position-change',
'npm run test:protocol-fee',
'npm run test:target',
'npm run test:slippage',
'npm run test:position-slippage',
'npm run test:fee-tier',
'npm run test:big-swap',
# 'npm run test:create',
# 'npm run test:stake',
# 'npm run test:multicall',
'npm run test:oracle',
'npm run test:limits',
'npm run test:compare',
'npm run test:max-tick-cross',
# 'npm run test:close-stake',
'cargo test',
'npm run test:referral-default',
'npm run test:referral-all',
'npm run test:referral-none',
'npm run test:referral-jupiter',
'npm run test:token2022',
'cargo test --features "all"',
'cargo test --features "none"',
'cargo test --features "jupiter"'
]
steps:
- uses: actions/checkout@v2
- name: test
run: |
echo "${{ matrix.case }}"
- uses: actions/cache@v2
name: Cache Cargo registry + index
id: cache-anchor
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ runner.os }}-v0000-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v2
name: Cache Solana Tool Suite
id: cache-solana
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-${{ runner.os }}-v0000-${{ env.solana_version }}
- uses: actions/cache@v2
name: Cache target folder
id: cache-programs
with:
path: |
./target
key: solana-${{ runner.os }}-v0000-${{ hashFiles('**/programs/**/*.rs') }}-${{ hashFiles('**/programs/**/*.toml') }}
- uses: actions/cache@v2
name: Cache Node Modules
id: cache-node-modules
with:
path: |
~/.npm/
./node_modules
key: npm-${{ runner.os }}-v0000-${{ hashFiles('**/package-lock.json') }}
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.79
override: true
- name: install global mocha
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
npm install -g mocha
npm install -g ts-mocha
npm install -g typescript
npm install -g @project-serum/anchor
ts-mocha -h
- name: install essential
run: |
sudo apt-get update
sudo apt-get install -y pkg-config build-essential libudev-dev
- name: install solana
if: steps.cache-solana.outputs.cache-hit != 'true'
run: |
sh -c "$(curl -sSfL https://release.solana.com/v${{ env.solana_version }}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
- name: setup solana
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
solana-keygen new -o "$HOME/.config/solana/id.json" --no-passphrase --silent
- name: install Anchor
if: steps.cache-anchor.outputs.cache-hit != 'true'
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo install --git https://github.com/project-serum/anchor --tag v${{ env.anchor_version }} anchor-cli --locked
- name: build programs
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
anchor build
- name: install
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
npm install
- name: build invariant sdk & staker sdk
run: |
npm run build:all
- name: test
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
${{ matrix.case }}