Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor bankrun #113

Merged
merged 14 commits into from
Aug 27, 2024
21 changes: 8 additions & 13 deletions .github/.ghaignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,21 @@ tokens/nft-minter/native
tokens/transfer-tokens/native
tokens/spl-token-minter/native
tokens/create-token/native
tokens/create-token/anchor
tokens/nft-minter/anchor
tokens/pda-mint-authority/anchor
tokens/spl-token-minter/anchor

tokens/token-swap/anchor
tokens/transfer-tokens/anchor

# not building
oracles/pyth/anchor

# avm broke hence can't build
# can't use anchor.toml [toolchain] with stable rust
# update these programs to use latest anchor version to fix
tokens/token-2022/group/anchor
tokens/token-2022/immutable-owner/anchor
tokens/token-2022/interest-bearing/anchor
tokens/token-2022/memo-transfer/anchor

# not building
compression/cutils/anchor
compression/cnft-vault/anchor
# builds but need to test on localhost
compression/cnft-burn/anchor

# test failing
# https://github.com/solana-developers/helpers/issues/40
tokens/escrow/anchor

# not live
tokens/token-2022/group/anchor
8 changes: 7 additions & 1 deletion .github/workflows/anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,31 +125,37 @@ jobs:
function build_and_test() {
local project=$1
echo "Building and Testing $project"
cd "$project"
cd "$project" || return 1

# Run anchor build
if ! anchor build; then
echo "::error::anchor build failed for $project"
echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
rm -rf target
cd - > /dev/null
return 1
fi

# Install dependencies
if ! pnpm install --frozen-lockfile; then
echo "::error::pnpm install failed for $project"
echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
fi

# Run anchor test
if ! anchor test; then
echo "::error::anchor test failed for $project"
echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
rm -rf target node_modules
cd - > /dev/null
return 1
fi

echo "Build and tests succeeded for $project."
rm -rf target node_modules
cd - > /dev/null
return 0
}

Expand Down
5 changes: 4 additions & 1 deletion basics/account-data/anchor/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"dependencies": {
"@coral-xyz/anchor": "^0.30.0"
"@coral-xyz/anchor": "^0.30.0",
"@solana/web3.js": "^1.95.2"
},
"devDependencies": {
"anchor-bankrun": "^0.4.0",
"solana-bankrun": "^0.3.0",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
Expand Down
Loading