11name : Setup Environment
2- description : Setup Rust, Solana CLI, and Light CLI for testing
2+ description : Setup Rust, Solana CLI, and optionally Node.js for testing
33
44inputs :
5+ example :
6+ description : " Example directory path (used for Rust workspace caching)"
7+ required : false
8+ default : " "
9+ node-version :
10+ description : " Node.js version to install (optional, empty = minimal Node for Light CLI only)"
11+ required : false
12+ default : " "
513 solana-cli-version :
614 description : " Solana CLI version"
715 required : false
8- default : " 2.1.21 "
16+ default : " 2.3.11 "
917 rust-toolchain :
1018 description : " Rust toolchain version"
1119 required : false
12- default : " 1.85 .0"
20+ default : " 1.90 .0"
1321 light-cli-version :
1422 description : " Light CLI version"
1523 required : false
1624 default : " alpha"
25+ photon-indexer :
26+ description : " Install Photon indexer (required for TypeScript tests)"
27+ required : false
28+ default : " false"
1729
1830runs :
1931 using : composite
@@ -22,18 +34,19 @@ runs:
2234 uses : actions-rust-lang/setup-rust-toolchain@v1
2335 with :
2436 toolchain : ${{ inputs.rust-toolchain }}
25- cache : false
37+ cache-workspaces : ${{ inputs.example || '.' }}
2638
27- - name : Setup Node.js (for Light CLI)
39+ - name : Setup Node.js
40+ if : inputs.node-version != ''
2841 uses : actions/setup-node@v4
2942 with :
30- node-version : " 22 "
43+ node-version : ${{ inputs.node-version }}
3144
32- - name : Cache npm global packages
33- uses : actions/cache@v4
45+ - name : Setup Node.js (for Light CLI)
46+ if : inputs.node-version == ''
47+ uses : actions/setup-node@v4
3448 with :
35- path : ~/.npm
36- key : npm-${{ runner.os }}-light-cli-${{ inputs.light-cli-version }}
49+ node-version : " 22"
3750
3851 - name : Cache Solana CLI tools
3952 uses : actions/cache@v4
5366 shell : bash
5467 run : npm install -g @lightprotocol/zk-compression-cli@${{ inputs.light-cli-version }}
5568
69+ - name : Cache Photon indexer
70+ if : inputs.photon-indexer == 'true'
71+ id : cache-photon
72+ uses : actions/cache@v4
73+ with :
74+ path : ~/.cargo/bin/photon
75+ key : photon-${{ runner.os }}-ac7df6c388db847b7693a7a1cb766a7c9d7809b5
76+
77+ - name : Install Photon indexer
78+ if : inputs.photon-indexer == 'true' && steps.cache-photon.outputs.cache-hit != 'true'
79+ shell : bash
80+ env :
81+ RUSTFLAGS : " -A dead-code"
82+ run : cargo install --git https://github.com/lightprotocol/photon.git --rev ac7df6c388db847b7693a7a1cb766a7c9d7809b5 --locked --force
83+
5684 - name : Generate keypair
5785 shell : bash
5886 run : solana-keygen new --no-bip39-passphrase
6492 cargo --version
6593 solana --version
6694 light --version
67-
0 commit comments