Skip to content

Commit 986e169

Browse files
committed
move pnpm install in anchor workflow
1 parent 8dd4878 commit 986e169

File tree

8 files changed

+42
-75
lines changed

8 files changed

+42
-75
lines changed

.github/workflows/anchor.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ jobs:
126126
echo "Building and Testing $project"
127127
cd "$project" || return 1
128128
129+
# Install dependencies first
130+
if ! pnpm install --frozen-lockfile; then
131+
echo "::error::pnpm install failed for $project"
132+
echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
133+
cd - > /dev/null
134+
return 1
135+
fi
136+
129137
# Run anchor build
130138
if ! anchor build; then
131139
echo "::error::anchor build failed for $project"
@@ -135,14 +143,6 @@ jobs:
135143
return 1
136144
fi
137145
138-
# Install dependencies
139-
if ! pnpm install --frozen-lockfile; then
140-
echo "::error::pnpm install failed for $project"
141-
echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
142-
cd - > /dev/null
143-
return 1
144-
fi
145-
146146
# Run anchor test
147147
if ! anchor test; then
148148
echo "::error::anchor test failed for $project"

basics/account-data/anchor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"dependencies": {
3-
"@coral-xyz/anchor": "^0.30.0",
3+
"@coral-xyz/anchor": "0.31.1",
44
"@solana/web3.js": "^1.95.2"
55
},
66
"devDependencies": {
7-
"anchor-bankrun": "^0.4.0",
8-
"solana-bankrun": "^0.3.0",
97
"@types/bn.js": "^5.1.0",
108
"@types/chai": "^4.3.0",
119
"@types/mocha": "^9.0.0",
10+
"anchor-bankrun": "^0.4.0",
1211
"chai": "^4.3.4",
1312
"mocha": "^9.0.3",
13+
"solana-bankrun": "^0.3.0",
1414
"ts-mocha": "^10.0.0",
1515
"typescript": "^4.3.5"
1616
},

basics/checking-accounts/anchor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"type": "module",
33
"dependencies": {
4-
"@coral-xyz/anchor": "^0.30.0",
4+
"@coral-xyz/anchor": "0.31.1",
55
"@solana/web3.js": "^1.95.2"
66
},
77
"devDependencies": {
8-
"anchor-bankrun": "^0.4.0",
9-
"solana-bankrun": "^0.3.0",
108
"@types/bn.js": "^5.1.0",
119
"@types/chai": "^4.3.0",
1210
"@types/mocha": "^9.0.0",
11+
"anchor-bankrun": "^0.4.0",
1312
"chai": "^4.3.4",
1413
"mocha": "^9.0.3",
14+
"solana-bankrun": "^0.3.0",
1515
"ts-mocha": "^10.0.0",
1616
"typescript": "^4.3.5"
1717
}

basics/close-account/anchor/pnpm-lock.yaml

Lines changed: 21 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

basics/favorites/anchor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
66
},
77
"dependencies": {
8-
"@coral-xyz/anchor": "^0.30.0",
8+
"@coral-xyz/anchor": "0.31.1",
99
"@solana-developers/helpers": "^2.0.0",
1010
"@solana/web3.js": "^1.95.2"
1111
},
1212
"license": "MIT",
1313
"devDependencies": {
14-
"anchor-bankrun": "^0.4.0",
15-
"solana-bankrun": "^0.3.0",
1614
"@types/bn.js": "^5.1.0",
1715
"@types/chai": "^4.3.0",
1816
"@types/mocha": "^9.0.0",
17+
"anchor-bankrun": "^0.4.0",
1918
"chai": "^4.3.4",
2019
"mocha": "^9.0.3",
2120
"prettier": "^2.6.2",
21+
"solana-bankrun": "^0.3.0",
2222
"ts-mocha": "^10.0.0",
2323
"typescript": "^4.3.5"
2424
}

basics/favorites/anchor/programs/favorites/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ idl-build = ["anchor-lang/idl-build"]
1818

1919
[dependencies]
2020
anchor-lang = {version = "0.31.1", features = ["init-if-needed"]}
21-
solana-program = "=2.0.3"

basics/hello-solana/anchor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"type": "module",
33
"dependencies": {
4-
"@coral-xyz/anchor": "^0.30.0",
4+
"@coral-xyz/anchor": "0.31.1",
55
"@solana/web3.js": "^1.95.2"
66
},
77
"devDependencies": {
8-
"anchor-bankrun": "^0.4.0",
9-
"solana-bankrun": "^0.3.0",
108
"@types/bn.js": "^5.1.0",
119
"@types/chai": "^4.3.0",
1210
"@types/mocha": "^9.0.0",
11+
"anchor-bankrun": "^0.4.0",
1312
"chai": "^4.3.4",
1413
"mocha": "^9.0.3",
14+
"solana-bankrun": "^0.3.0",
1515
"ts-mocha": "^10.0.0",
1616
"typescript": "^4.3.5"
1717
}

basics/hello-solana/anchor/tests/bankrun.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as anchor from "@coral-xyz/anchor";
33
import { PublicKey } from "@solana/web3.js";
44
import { BankrunProvider } from "anchor-bankrun";
55
import { startAnchor } from "solana-bankrun";
6-
import { HelloSolana } from "../target/types/hello_solana";
6+
import type { HelloSolana } from "../target/types/hello_solana";
77

88
import IDL from "../target/idl/hello_solana.json" with { type: "json" };
99
const PROGRAM_ID = new PublicKey(IDL.address);

0 commit comments

Comments
 (0)