@@ -3,20 +3,32 @@ description: Setup Rust, Solana CLI, and optionally Node.js for testing
33
44inputs :
55 example :
6- description : ' Example directory path'
6+ description : " Example directory path"
77 required : true
88 node-version :
9- description : ' Node.js version to install (optional)'
9+ description : " Node.js version to install (optional)"
1010 required : false
11- default : ' '
11+ default : " "
12+ node-version-default :
13+ description : " Default Node.js version for Light CLI"
14+ required : false
15+ default : " 22"
1216 solana-cli-version :
13- description : ' Solana CLI version'
17+ description : " Solana CLI version"
1418 required : false
15- default : ' 2.3.11'
19+ default : " 2.3.11"
1620 rust-toolchain :
17- description : ' Rust toolchain version'
21+ description : " Rust toolchain version"
22+ required : false
23+ default : " 1.90.0"
24+ anchor-version :
25+ description : " Anchor CLI version (for TypeScript tests)"
26+ required : false
27+ default : " 0.31.1"
28+ photon-indexer :
29+ description : " Install Photon indexer (required for TypeScript tests)"
1830 required : false
19- default : ' 1.90.0 '
31+ default : " false "
2032
2133runs :
2234 using : composite
@@ -27,22 +39,58 @@ runs:
2739 toolchain : ${{ inputs.rust-toolchain }}
2840 cache-workspaces : ${{ inputs.example }}
2941
30- - name : Install Solana CLI
31- uses : heyAyushh/setup-solana@v5.5
42+ - name : Setup Node.js
43+ if : inputs.node-version != ''
44+ uses : actions/setup-node@v4
3245 with :
33- solana-cli- version : ${{ inputs.solana-cli -version }}
46+ node- version : ${{ inputs.node -version }}
3447
35- - name : Setup Node.js
48+ - name : Setup Node.js (for Light CLI)
49+ if : inputs.node-version == ''
3650 uses : actions/setup-node@v4
3751 with :
38- node-version : ${{ inputs.node-version != '' && inputs.node-version || '22' }}
39- cache : ${{ inputs.node-version != '' && 'npm' || '' }}
40- cache-dependency-path : ${{ inputs.node-version != '' && format('{0}/package-lock.json', inputs.example) || '' }}
52+ node-version : ${{ inputs.node-version-default }}
53+
54+ - name : Cache Solana CLI tools
55+ uses : actions/cache@v4
56+ with :
57+ path : |
58+ ~/.cache/solana/
59+ ~/.local/share/solana/
60+ key : solana-cli-${{ runner.os }}-build-${{ inputs.solana-cli-version }}
61+
62+ - name : Install Solana CLI tools
63+ shell : bash
64+ run : |
65+ if [[ "${{ inputs.solana-cli-version }}" == 1* ]]; then
66+ cd $HOME
67+ wget -q https://github.com/solana-labs/solana/releases/download/v${{ inputs.solana-cli-version }}/solana-release-x86_64-unknown-linux-gnu.tar.bz2
68+ tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
69+ echo "$HOME/solana-release/bin" >> $GITHUB_PATH
70+ else
71+ sh -c "$(curl -sSfL https://release.anza.xyz/v${{ inputs.solana-cli-version }}/install)"
72+ echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
73+ fi
74+
75+ - name : Install Anchor CLI
76+ if : inputs.node-version != ''
77+ shell : bash
78+ run : |
79+ cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
80+ avm install ${{ inputs.anchor-version }}
81+ avm use ${{ inputs.anchor-version }}
4182
4283 - name : Install Light CLI
4384 shell : bash
4485 run : npm install -g @lightprotocol/zk-compression-cli
4586
87+ - name : Install Photon indexer
88+ if : inputs.photon-indexer == 'true'
89+ shell : bash
90+ env :
91+ RUSTFLAGS : " -A dead-code"
92+ run : cargo install --git https://github.com/lightprotocol/photon.git --rev 49b7e7f0d668babbc4d65fe8a0a7236df76f75a8 --locked
93+
4694 - name : Generate keypair
4795 shell : bash
4896 run : solana-keygen new --no-bip39-passphrase
0 commit comments