Skip to content

Commit 9ca07b5

Browse files
authored
feat: upgrade program to anchor 0.29.0 solana 1.18.0 (#181)
* feat: upgrade program to anchor 0.29.0 solana 1.18.0 * feat: update integration tests for anchor updated pacakge deps * feat: use yarn 3.6.0 * ci: use test matrix * test: remove orca sdk * test: add debug dep for metaplex
1 parent ca79279 commit 9ca07b5

File tree

567 files changed

+11366
-6063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

567 files changed

+11366
-6063
lines changed

.github/workflows/ci_cd.yml

+72-138
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI/CD
22
env:
3-
cli-id: anchor-v0.25.0.solana-1.10.32.v1
3+
cli-id: anchor-v0.29.0.solana-1.18.0.v1
44
SWAP_PROGRAM_OWNER_FEE_ADDRESS: HfoTxFR1Tm6kGmWgYWD6J7YHVy1UwqSULUGVLXkJqaKN
55
on:
66
push:
@@ -57,12 +57,12 @@ jobs:
5757
- name: Install Solana Tools
5858
id: install-solana-tools
5959
if: steps.cache-deps.outputs.cache-hit != 'true'
60-
run: sh -c "$(curl -sSfL https://release.solana.com/v1.10.32/install)"
60+
run: sh -c "$(curl -sSfL https://release.solana.com/v1.18.0/install)"
6161

6262
- name: Install Anchor CLI
6363
id: install-anchor-cli
6464
if: steps.cache-deps.outputs.cache-hit != 'true'
65-
run: cargo install --git https://github.com/project-serum/anchor --tag v0.25.0 anchor-cli --locked
65+
run: cargo install --git https://github.com/project-serum/anchor --tag v0.29.0 anchor-cli --locked
6666

6767
- name: Add Solana Tools to Path
6868
run: echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
@@ -71,12 +71,11 @@ jobs:
7171
if: steps.cache-deps.outputs.cache-hit != 'true'
7272
run: |
7373
npm install -g typescript
74-
npm install -g yarn
74+
corepack enable
75+
yarn set version 3.6.0
7576
npm install -g ts-mocha
76-
npm install -g @project-serum/anchor
77-
yarn
78-
79-
- run: npm list -g
77+
npm install -g @coral-xyz/anchor
78+
yarn install
8079
8180
- name: Build Programs
8281
run: anchor build
@@ -86,7 +85,7 @@ jobs:
8685

8786
lint:
8887
runs-on: ubuntu-latest
89-
needs: [build]
88+
needs: [ build ]
9089
steps:
9190
- uses: actions/checkout@v2
9291
with:
@@ -104,13 +103,13 @@ jobs:
104103
/opt/hostedtoolcache/node
105104
target
106105
node_modules
107-
106+
- run: yarn install
108107
- run: cargo fmt -- --check
109108
- run: yarn run prettier --c ./
110109

111110
test-unit:
112111
runs-on: ubuntu-latest
113-
needs: [build]
112+
needs: [ build ]
114113
steps:
115114
- uses: actions/checkout@v2
116115
with:
@@ -138,69 +137,26 @@ jobs:
138137
- name: unit test
139138
run: cargo test
140139

141-
test-integration-batch-1:
142-
runs-on: ubuntu-latest
143-
needs: [build, lint, test-unit]
144-
steps:
145-
- uses: actions/checkout@v2
146-
with:
147-
fetch-depth: 0
148-
149-
- name: ⚡️ Cache
150-
id: cache-deps
151-
uses: actions/cache@v2
152-
with:
153-
key: $${{ env.cli-id }}
154-
path: |
155-
~/.local/share/solana
156-
~/.cargo
157-
~/.rustup
158-
/opt/hostedtoolcache/node
159-
target
160-
node_modules
161-
162-
- uses: actions/setup-node@v2
163-
with:
164-
node-version: '16.13.0'
165-
166-
- run: echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
167-
- name: Create Test Wallet
168-
run: solana-keygen new --no-bip39-passphrase
169-
- run: anchor test tests/integration-tests/batch1/*.ts
170-
171-
test-integration-batch-2:
140+
program-integration-tests:
141+
needs: [ build, lint, test-unit ]
172142
runs-on: ubuntu-latest
173-
needs: [build, lint, test-unit]
174-
steps:
175-
- uses: actions/checkout@v2
176-
with:
177-
fetch-depth: 0
178-
179-
- name: ⚡️ Cache
180-
id: cache-deps
181-
uses: actions/cache@v2
182-
with:
183-
key: $${{ env.cli-id }}
184-
path: |
185-
~/.local/share/solana
186-
~/.cargo
187-
~/.rustup
188-
/opt/hostedtoolcache/node
189-
target
190-
node_modules
191-
192-
- uses: actions/setup-node@v2
193-
with:
194-
node-version: '16.13.0'
195-
196-
- run: echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
197-
- name: Create Test Wallet
198-
run: solana-keygen new --no-bip39-passphrase
199-
- run: anchor test tests/integration-tests/batch2/*.ts
200-
201-
test-integration-batch-3:
202-
runs-on: ubuntu-latest
203-
needs: [build, lint, test-unit]
143+
strategy:
144+
matrix:
145+
test:
146+
[
147+
{
148+
scope: "tests/integration-tests/batch1/*.ts",
149+
},
150+
{
151+
scope: "tests/integration-tests/batch2/*.ts",
152+
},
153+
{
154+
scope: "tests/integration-tests/batch3/*.ts",
155+
},
156+
{
157+
scope: "tests/integration-tests/batch4/*.ts",
158+
},
159+
]
204160
steps:
205161
- uses: actions/checkout@v2
206162
with:
@@ -222,42 +178,20 @@ jobs:
222178
- uses: actions/setup-node@v2
223179
with:
224180
node-version: '16.13.0'
181+
182+
- run: |
183+
corepack enable
184+
yarn set version 3.6.0
185+
yarn install
225186
226187
- run: echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
188+
227189
- name: Create Test Wallet
228190
run: solana-keygen new --no-bip39-passphrase
229-
- run: anchor test tests/integration-tests/batch3/*.ts
230-
231-
test-integration-batch-4:
232-
runs-on: ubuntu-latest
233-
needs: [build, lint, test-unit]
234-
steps:
235-
- uses: actions/checkout@v2
236-
with:
237-
fetch-depth: 0
238-
239-
- name: ⚡️ Cache
240-
id: cache-deps
241-
uses: actions/cache@v2
242-
with:
243-
key: $${{ env.cli-id }}
244-
path: |
245-
~/.local/share/solana
246-
~/.cargo
247-
~/.rustup
248-
/opt/hostedtoolcache/node
249-
target
250-
node_modules
251-
252-
- uses: actions/setup-node@v2
253-
with:
254-
node-version: '16.13.0'
191+
192+
- name: Run Test
193+
run: anchor test ${{ matrix.test.scope }}
255194

256-
- run: echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
257-
- name: Create Test Wallet
258-
run: solana-keygen new --no-bip39-passphrase
259-
- run: anchor test tests/integration-tests/batch4/*.ts
260-
261195
# audit:
262196
# runs-on: ubuntu-latest
263197
# needs: [build]
@@ -288,44 +222,44 @@ jobs:
288222
# continue-on-error: false
289223
# uses: silas-x/soteria-action@main
290224
# with:
291-
# solana-version: "1.10.32"
225+
# solana-version: "1.18.0"
292226
# run-mode: "-analyzeAll"
293227
# cargo-com: "."
294228
# program-path: "programs/drip"
295229

296-
deploy:
297-
if: github.ref == 'refs/heads/main'
298-
needs: [test-integration-batch-1, test-integration-batch-2, test-integration-batch-3, test-integration-batch-4]
299-
runs-on: ubuntu-latest
300-
steps:
301-
- uses: actions/checkout@v2
302-
with:
303-
submodules: 'true'
304-
fetch-depth: 0
230+
# deploy:
231+
# if: github.ref == 'refs/heads/main'
232+
# needs: [ test-integration-batch-1, test-integration-batch-2, test-integration-batch-3, test-integration-batch-4 ]
233+
# runs-on: ubuntu-latest
234+
# steps:
235+
# - uses: actions/checkout@v2
236+
# with:
237+
# submodules: 'true'
238+
# fetch-depth: 0
305239

306-
- name: Setup Node
307-
uses: actions/setup-node@v2
308-
with:
309-
node-version: '16.13.0'
240+
# - name: Setup Node
241+
# uses: actions/setup-node@v2
242+
# with:
243+
# node-version: '16.13.0'
310244

311-
- name: ⚡️ Cache
312-
id: cache-deps
313-
uses: actions/cache@v2
314-
with:
315-
key: $${{ env.cli-id }}
316-
path: |
317-
~/.local/share/solana
318-
~/.cargo
319-
~/.rustup
320-
/opt/hostedtoolcache/node
321-
target
322-
node_modules
323-
324-
- name: Add Solana Tools to Path
325-
run: echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
245+
# - name: ⚡️ Cache
246+
# id: cache-deps
247+
# uses: actions/cache@v2
248+
# with:
249+
# key: $${{ env.cli-id }}
250+
# path: |
251+
# ~/.local/share/solana
252+
# ~/.cargo
253+
# ~/.rustup
254+
# /opt/hostedtoolcache/node
255+
# target
256+
# node_modules
257+
258+
# - name: Add Solana Tools to Path
259+
# run: echo "PATH=$HOME/.local/share/solana/install/active_release/bin:$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
326260

327-
- name: Deploy Devnet Staging Program
328-
run: ./scripts/deploy-devnet-staging.sh
329-
env:
330-
UPGRADE_AUTHORITY: ${{ secrets.UPGRADE_AUTHORITY }}
331-
DRIP_KEYPAIR: ${{ secrets.DRIP_KEYPAIR }}
261+
# - name: Deploy Devnet Staging Program
262+
# run: ./scripts/deploy-devnet-staging.sh
263+
# env:
264+
# UPGRADE_AUTHORITY: ${{ secrets.UPGRADE_AUTHORITY }}
265+
# DRIP_KEYPAIR: ${{ secrets.DRIP_KEYPAIR }}

.prettierignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ build
55
.github
66
.anchor
77
*.rs
8-
deps/
8+
deps/
9+
**/idl/**/
10+
.yarn/
11+
*.cjs
12+
*.mjs
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
23.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)