Skip to content

Commit 1bb05a9

Browse files
committed
2 parents 629dd6b + b237b18 commit 1bb05a9

File tree

70 files changed

+11510
-190
lines changed

Some content is hidden

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

70 files changed

+11510
-190
lines changed

Diff for: .github/.ghaignore

+5
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ compression/cutils/anchor
3333
compression/cnft-vault/anchor
3434
# builds but need to test on localhost
3535
compression/cnft-burn/anchor
36+
37+
# not building due to > spl 2.0 dependency issue
38+
tokens/token-2022/group/anchor
39+
tokens/token-2022/nft-meta-data-pointer/anchor-example/anchor
40+
tokens/escrow/anchor

Diff for: .github/workflows/anchor.yml

+40-33
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,30 @@ jobs:
1919
strategy:
2020
matrix:
2121
node-version: [20.x]
22-
solana-version: [1.18.8, beta]
23-
anchor-version: [0.30.0]
22+
solana-version: [1.18.17, stable]
23+
anchor-version: [0.30.1]
2424
steps:
2525
- uses: actions/checkout@v4
26+
- uses: dorny/paths-filter@v3
27+
if: github.event_name == 'pull_request'
28+
id: changes
29+
with:
30+
list-files: shell
31+
filters: |
32+
anchor:
33+
- added|modified: '**/anchor/**'
34+
anchor_action:
35+
- added|modified: '**/workflows/anchor.yml'
36+
2637
- name: Setup Anchor
27-
uses: heyAyushh/[email protected]
38+
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule' || github.event_name == 'push'
39+
uses: heyAyushh/[email protected]
2840
with:
2941
anchor-version: ${{ matrix.anchor-version }}
3042
solana-cli-version: ${{ matrix.solana-version }}
3143
node-version: ${{ matrix.node-version }}
32-
- name: Display versions
44+
- name: Display versions and Install pnpm
45+
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule'
3346
run: |
3447
solana -V
3548
solana-keygen new --no-bip39-passphrase
@@ -38,16 +51,8 @@ jobs:
3851
npm i -g pnpm
3952
# Run only if it's triggered by PR to main,
4053
# Build the changed programs
41-
- uses: dorny/paths-filter@v3
42-
if: github.event_name == 'pull_request'
43-
id: changes
44-
with:
45-
list-files: shell
46-
filters: |
47-
anchor:
48-
- added|modified: '**/anchor/**'
4954
- name: Build Changed Anchor programs
50-
if: ${{ steps.changes.outputs.anchor == 'true' }}
55+
if: steps.changes.outputs.anchor == 'true' && steps.changes.outputs.anchor_action != 'true'
5156
run: |
5257
changed_files=(${{ steps.changes.outputs.anchor_files }})
5358
@@ -91,7 +96,7 @@ jobs:
9196
shell: bash
9297
# Skip Building all Programs if it's a PR to main branch
9398
- name: Build All Anchor programs
94-
if: github.event_name != 'pull_request'
99+
if: github.event_name == 'schedule' || github.event_name == 'push' || steps.changes.outputs.anchor_action == 'true'
95100
run: |
96101
# Find all anchor projects and remove ignored projects
97102
declare -a ProjectDirs=($(find . -type d -name 'anchor' | sed 's|^\./||'| grep -v -f <(grep . .github/.ghaignore | grep -v '^$')))
@@ -132,35 +137,38 @@ jobs:
132137
strategy:
133138
matrix:
134139
node-version: [20.x]
135-
solana-version: [1.18.8, beta]
136-
anchor-version: [0.30.0]
140+
solana-version: [1.18.17, stable]
141+
anchor-version: [0.30.1]
137142
steps:
138143
- uses: actions/checkout@v4
144+
- uses: dorny/paths-filter@v3
145+
if: github.event_name == 'pull_request'
146+
id: changes
147+
with:
148+
list-files: shell
149+
filters: |
150+
anchor:
151+
- added|modified: '**/anchor/**'
152+
anchor_action:
153+
- added|modified: '**/workflows/anchor.yml'
154+
# Skip Installing and Displaying versions if theres no change in anchor programs or anchor action workflow file or isn't a schedule event
139155
- name: Setup Anchor
140-
uses: heyAyushh/[email protected]
156+
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule' || github.event_name == 'push'
157+
uses: heyAyushh/[email protected]
141158
with:
142159
anchor-version: ${{ matrix.anchor-version }}
143160
solana-cli-version: ${{ matrix.solana-version }}
144161
node-version: ${{ matrix.node-version }}
145-
- name: Display versions
162+
- name: Display versions and Install pnpm
163+
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule'
146164
run: |
147165
solana -V
148166
solana-keygen new --no-bip39-passphrase
149167
rustc -V
150168
anchor -V
151169
npm i -g pnpm
152-
# Run only if it's triggered by PR to main,
153-
# Test the changed programs (if any)
154-
- uses: dorny/paths-filter@v3
155-
if: github.event_name == 'pull_request'
156-
id: changes
157-
with:
158-
list-files: shell
159-
filters: |
160-
anchor:
161-
- added|modified: '**/anchor/**'
162170
- name: Test Changed Anchor Programs
163-
if: ${{ steps.changes.outputs.anchor == 'true' }}
171+
if: steps.changes.outputs.anchor == 'true' && steps.changes.outputs.anchor_action != 'true'
164172
run: |
165173
changed_files=(${{ steps.changes.outputs.anchor_files }})
166174
ProjectDirs=($(for file in "${changed_files[@]}"; do dirname "${file}" | grep anchor | sed 's#/anchor/.*#/anchor#g'; done | grep -v -f <(grep . .github/.ghaignore | grep -v '^$') | sort -u))
@@ -172,8 +180,7 @@ jobs:
172180
Testing $projectDir
173181
********"
174182
cd $projectDir
175-
pnpm install --frozen-lockfile
176-
if anchor test; then
183+
if pnpm install --frozen-lockfile && anchor test; then
177184
echo "Tests succeeded for $projectDir."
178185
rm -rf target node_modules
179186
else
@@ -192,9 +199,9 @@ jobs:
192199
echo "All tests passed."
193200
fi
194201
shell: bash
195-
# Skip Testing all Programs if it's a PR to main branch
202+
# Skip Testing all Programs if it's a CRON job or a change in the workflow file
196203
- name: Test All Anchor Programs
197-
if: github.event_name != 'pull_request'
204+
if: github.event_name == 'schedule' || steps.changes.outputs.anchor_action == 'true'
198205
run: |
199206
declare -a ProjectDirs=($(find . -type d -name "anchor"| grep -v -f <(grep . .github/.ghaignore | grep -v '^$')))
200207
echo "Projects to Test:"

Diff for: .github/workflows/solana-native.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
node-version: [20.x]
20-
solana-version: [stable, beta]
20+
solana-version: [stable]
2121
steps:
2222
- uses: actions/checkout@v4
2323
- name: Use Node.js ${{ matrix.node-version }}
@@ -67,7 +67,7 @@ jobs:
6767
strategy:
6868
matrix:
6969
node-version: [20.x]
70-
solana-version: [1.17.25, stable, beta]
70+
solana-version: [1.17.25, stable]
7171
steps:
7272
- uses: actions/checkout@v4
7373
- name: Use Node.js ${{ matrix.node-version }}

Diff for: basics/counter/seahorse/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ cluster = "localnet"
1212
wallet = "~/.config/solana/id.json"
1313

1414
[scripts]
15-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
15+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

Diff for: basics/favorites/anchor/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ cluster = "Localnet"
1515
wallet = "~/.config/solana/id.json"
1616

1717
[scripts]
18-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
18+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

Diff for: basics/hello-solana/anchor/tests/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as anchor from '@coral-xyz/anchor';
2-
import type { HelloSolana } from '../target/types/hello_solana';
2+
import { HelloSolana } from '../target/types/hello_solana';
33

44
describe('hello-solana', () => {
55
// Configure the Anchor provider & load the program IDL

Diff for: basics/hello-solana/seahorse/hello_solana/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ cluster = "localnet"
1111
wallet = "/home/thefunnyintrovert/.config/solana/id.json"
1212

1313
[scripts]
14-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
14+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

Diff for: basics/transfer-sol/seahorse/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ cluster = "Localnet"
1212
wallet = "/Users/devenv/.config/solana/id.json"
1313

1414
[scripts]
15-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
15+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

Diff for: biome.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
33
"organizeImports": {
44
"enabled": true
55
},
@@ -13,7 +13,8 @@
1313
"noExportsInTest": "warn"
1414
},
1515
"style": {
16-
"noParameterAssign": "warn"
16+
"noParameterAssign": "warn",
17+
"useImportType": "off"
1718
},
1819
"complexity": {
1920
"noForEach": "warn",

Diff for: compression/cnft-burn/anchor/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ cluster = "Devnet"
1515
wallet = "~/.config/solana/id.json"
1616

1717
[scripts]
18-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/cnft-burn.ts"
18+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/cnft-burn.ts"

Diff for: compression/cnft-vault/anchor/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ cluster = "Devnet"
1212
wallet = "~/.config/solana/id.json"
1313

1414
[scripts]
15-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
15+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

Diff for: compression/cutils/anchor/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ cluster = "devnet"
1212
wallet = "~/.config/solana/test.json"
1313

1414
[scripts]
15-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
15+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

Diff for: oracles/pyth/anchor/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cluster = "Localnet"
1212
wallet = "~/.config/solana/id.json"
1313

1414
[scripts]
15-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
15+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
1616

1717
[test.validator]
1818
url = "https://api.mainnet-beta.solana.com"

Diff for: oracles/pyth/seahorse/Anchor.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cluster = "Localnet"
1212
wallet = "~/.config/solana/id.json"
1313

1414
[scripts]
15-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
15+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
1616

1717
[test.validator]
1818
url = "https://api.mainnet-beta.solana.com"

0 commit comments

Comments
 (0)