-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tokens native, formatter, trigger action on project changes
- Loading branch information
Showing
697 changed files
with
33,935 additions
and
10,195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# build and test error | ||
basics/realloc/native | ||
basics/cross-program-invocation/native | ||
|
||
# uses generated client from shank, can't rewrite to solana-bankrun | ||
tools/shank-and-solita/native | ||
|
||
# can't test on localnet | ||
tokens/pda-mint-authority/native | ||
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 with stable solana | ||
tokens/token-2022/mint-close-authority/native | ||
tokens/token-2022/non-transferable/native | ||
tokens/token-2022/default-account-state/native | ||
tokens/token-2022/transfer-fee/native | ||
tokens/token-2022/multiple-extensions/native | ||
|
||
# not building | ||
oracles/pyth/anchor | ||
|
||
# not building | ||
compression/cutils/anchor | ||
compression/cnft-vault/anchor | ||
# builds but need to test on localhost | ||
compression/cnft-burn/anchor | ||
tokens/token-2022/nft-meta-data-pointer/anchor-example/anchor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,64 +14,92 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
solana-version: [1.18.8, beta] | ||
anchor-version: [0.30.0] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
check-latest: true | ||
- uses: heyAyushh/[email protected] | ||
- name: Setup Anchor | ||
uses: heyAyushh/[email protected] | ||
with: | ||
anchor-version: ${{ matrix.anchor-version }} | ||
solana-cli-version: ${{ matrix.solana-version }} | ||
- run: solana block | ||
shell: bash | ||
- name: Install Anchor | ||
node-version: ${{ matrix.node-version }} | ||
- name: Display versions | ||
run: | | ||
solana -V | ||
solana-keygen new --no-bip39-passphrase | ||
rustc -V | ||
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force | ||
avm install ${{ matrix.anchor-version }} | ||
avm use ${{ matrix.anchor-version }} | ||
npm install --global pnpm | ||
- name: Build Anchor programs | ||
anchor -V | ||
npm i -g pnpm | ||
# Run only if it's triggered by PR to main, | ||
# Build the changed programs | ||
- uses: dorny/paths-filter@v3 | ||
if: github.event_name == 'pull_request' | ||
id: changes | ||
with: | ||
list-files: shell | ||
filters: | | ||
anchor: | ||
- added|modified: '**/anchor/**' | ||
- name: Build Changed Anchor programs | ||
if: ${{ steps.changes.outputs.anchor == 'true' }} | ||
run: | | ||
changed_files=(${{ steps.changes.outputs.anchor_files }}) | ||
# Read ignored projects from .github/.ghaignore, ignoring empty lines and comments | ||
ignored_projects=($(grep . .github/.ghaignore | grep -v '^$')) | ||
# Find anchor projects and remove ignored projects | ||
ProjectDirs=($(for file in "${changed_files[@]}"; do | ||
anchor_path=$(dirname "${file}" | grep anchor | sed 's#/anchor/.*#/anchor#g') | ||
if [[ ! " ${ignored_projects[*]} " =~ " ${anchor_path} " ]]; then | ||
echo "$anchor_path" | ||
fi | ||
done | sort -u)) | ||
# Build anchor projects | ||
echo "Projects to Build:" | ||
printf "%s\n" "${ProjectDirs[@]}" | ||
for projectDir in "${ProjectDirs[@]}"; do | ||
echo " | ||
******** | ||
Building $projectDir | ||
********" | ||
cd $projectDir | ||
if anchor build; then | ||
echo "Build succeeded for $projectDir." | ||
rm -rf target | ||
else | ||
failed=true | ||
failed_builds+=($projectDir) | ||
echo "Build failed for $projectDir. Continuing with the next program." | ||
fi | ||
cd - > /dev/null | ||
done | ||
if [ "$failed" = true ]; then | ||
echo "Programs that failed building:" | ||
printf "%s\n" "${failed_builds[@]}" | ||
exit 1 | ||
else | ||
echo "All programs built successfully." | ||
fi | ||
shell: bash | ||
# Skip Building all Programs if it's a PR to main branch | ||
- name: Build All Anchor programs | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
declare -a ProjectDirs=( | ||
"basics/account-data/anchor" | ||
"basics/checking-accounts/anchor" | ||
"basics/close-account/anchor" | ||
"basics/counter/anchor" | ||
"basics/create-account/anchor" | ||
"basics/hello-solana/anchor" | ||
"basics/pda-rent-payer/anchor" | ||
"basics/processing-instructions/anchor" | ||
"basics/program-derived-addresses/anchor" | ||
"basics/realloc/anchor" | ||
"basics/rent/anchor" | ||
"basics/repository-layout/anchor" | ||
"basics/transfer-sol/anchor" | ||
"tokens/token-2022/basics/anchor" | ||
"tokens/token-2022/cpi-guard/anchor" | ||
"tokens/token-2022/default-account-state/anchor" | ||
"tokens/token-2022/group/anchor" | ||
"tokens/token-2022/immutable-owner/anchor" | ||
"tokens/token-2022/interest-bearing/anchor" | ||
"tokens/token-2022/memo-transfer/anchor" | ||
"tokens/token-2022/metadata/anchor" | ||
"tokens/token-2022/mint-close-authority/anchor" | ||
"tokens/token-2022/non-transferable/anchor" | ||
"tokens/token-2022/permanent-delegate/anchor" | ||
"tokens/token-2022/transfer-fee/anchor" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookCounter" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookHelloWorld" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookTransferCost" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookWhitelist" | ||
) | ||
# Find all anchor projects and remove ignored projects | ||
declare -a ProjectDirs=($(find . -type d -name 'anchor' | sed 's|^\./||'| grep -v -f <(grep . .github/.ghaignore | grep -v '^$'))) | ||
echo "Projects to Build:" | ||
printf "%s\n" "${ProjectDirs[@]}" | ||
# Build anchor projects | ||
for projectDir in "${ProjectDirs[@]}"; do | ||
echo " | ||
******** | ||
|
@@ -99,6 +127,8 @@ jobs: | |
|
||
test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
@@ -107,7 +137,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Anchor | ||
uses: heyAyushh/setup-anchor@v2.2 | ||
uses: heyAyushh/setup-anchor@v3.10 | ||
with: | ||
anchor-version: ${{ matrix.anchor-version }} | ||
solana-cli-version: ${{ matrix.solana-version }} | ||
|
@@ -119,39 +149,56 @@ jobs: | |
rustc -V | ||
anchor -V | ||
npm i -g pnpm | ||
- name: Test anchor programs | ||
# Run only if it's triggered by PR to main, | ||
# Test the changed programs (if any) | ||
- uses: dorny/paths-filter@v3 | ||
if: github.event_name == 'pull_request' | ||
id: changes | ||
with: | ||
list-files: shell | ||
filters: | | ||
anchor: | ||
- added|modified: '**/anchor/**' | ||
- name: Test Changed Anchor Programs | ||
if: ${{ steps.changes.outputs.anchor == 'true' }} | ||
run: | | ||
changed_files=(${{ steps.changes.outputs.anchor_files }}) | ||
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)) | ||
echo "Projects to Test:" | ||
printf "%s\n" "${ProjectDirs[@]}" | ||
for projectDir in "${ProjectDirs[@]}"; do | ||
echo " | ||
******** | ||
Testing $projectDir | ||
********" | ||
cd $projectDir | ||
pnpm install --frozen-lockfile | ||
if anchor test; then | ||
echo "Tests succeeded for $projectDir." | ||
rm -rf target node_modules | ||
else | ||
failed=true | ||
failed_tests+=($projectDir) | ||
echo "Tests failed for $val. Continuing with the next program." | ||
fi | ||
cd - > /dev/null | ||
done | ||
if [ "$failed" = true ]; then | ||
echo "*****************************" | ||
echo "Programs that failed testing:" | ||
printf "%s\n" "${failed_tests[@]}" | ||
exit 1 | ||
else | ||
echo "All tests passed." | ||
fi | ||
shell: bash | ||
# Skip Testing all Programs if it's a PR to main branch | ||
- name: Test All Anchor Programs | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
declare -a ProjectDirs=( | ||
"basics/account-data/anchor" | ||
"basics/checking-accounts/anchor" | ||
"basics/close-account/anchor" | ||
"basics/counter/anchor" | ||
"basics/create-account/anchor" | ||
"basics/hello-solana/anchor" | ||
"basics/pda-rent-payer/anchor" | ||
"basics/processing-instructions/anchor" | ||
"basics/program-derived-addresses/anchor" | ||
"basics/realloc/anchor" | ||
"basics/rent/anchor" | ||
"basics/repository-layout/anchor" | ||
"basics/transfer-sol/anchor" | ||
"tokens/token-2022/basics/anchor" | ||
"tokens/token-2022/cpi-guard/anchor" | ||
"tokens/token-2022/default-account-state/anchor" | ||
"tokens/token-2022/group/anchor" | ||
"tokens/token-2022/immutable-owner/anchor" | ||
"tokens/token-2022/interest-bearing/anchor" | ||
"tokens/token-2022/memo-transfer/anchor" | ||
"tokens/token-2022/metadata/anchor" | ||
"tokens/token-2022/mint-close-authority/anchor" | ||
"tokens/token-2022/non-transferable/anchor" | ||
"tokens/token-2022/permanent-delegate/anchor" | ||
"tokens/token-2022/transfer-fee/anchor" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookCounter" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookHelloWorld" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookTransferCost" | ||
"tokens/token-2022/transfer-hook/anchor/TransferHookWhitelist" | ||
) | ||
declare -a ProjectDirs=($(find . -type d -name "anchor"| grep -v -f <(grep . .github/.ghaignore | grep -v '^$'))) | ||
echo "Projects to Test:" | ||
printf "%s\n" "${ProjectDirs[@]}" | ||
for projectDir in "${ProjectDirs[@]}"; do | ||
echo " | ||
******** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Typescript Code quality | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [ opened, synchronize, reopened ] | ||
branches: | ||
- main | ||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Biome | ||
uses: biomejs/setup-biome@v2 | ||
- name: Run Biome | ||
run: | | ||
biome ci ./ --config-path biome.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.