feat: add native program examples #31
Workflow file for this run
This file contains hidden or 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
| name: TypeScript | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| SOLANA_CLI_VERSION: "2.3.11" | |
| RUST_TOOLCHAIN: "1.90.0" | |
| NODE_VERSION: "22" | |
| PHOTON_REV: "1a785036de52896b68d06413e3b0231122d6aa4a" | |
| jobs: | |
| typescript-tests: | |
| name: TypeScript Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cache Solana CLI tools | |
| id: cache-solana | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/solana/ | |
| ~/.local/share/solana/ | |
| key: solana-cli-${{ runner.os }}-${{ env.SOLANA_CLI_VERSION }} | |
| - name: Install Solana CLI tools | |
| if: steps.cache-solana.outputs.cache-hit != 'true' | |
| run: | | |
| sh -c "$(curl -sSfL https://release.anza.xyz/v${{ env.SOLANA_CLI_VERSION }}/install)" | |
| - name: Add Solana to PATH | |
| run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| - name: Install Light CLI | |
| run: npm install -g @lightprotocol/zk-compression-cli@alpha | |
| - name: Install Rust (for Photon) | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| cache: false | |
| - name: Cache Photon indexer | |
| id: cache-photon | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/bin/photon | |
| key: photon-${{ runner.os }}-${{ env.PHOTON_REV }} | |
| - name: Install Photon indexer | |
| if: steps.cache-photon.outputs.cache-hit != 'true' | |
| run: cargo install --git https://github.com/lightprotocol/photon.git --rev ${{ env.PHOTON_REV }} --locked | |
| env: | |
| RUSTFLAGS: "-A dead-code" | |
| - name: Add cargo bin to PATH | |
| run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Generate keypair | |
| run: solana-keygen new --no-bip39-passphrase | |
| - name: Install dependencies | |
| working-directory: typescript-client | |
| run: npm install | |
| - name: Start test validator | |
| run: | | |
| light test-validator & | |
| sleep 30 | |
| # Wait for Photon indexer to be ready | |
| for i in {1..30}; do | |
| if curl -s http://127.0.0.1:8784/health > /dev/null 2>&1; then | |
| echo "Photon indexer is ready" | |
| break | |
| fi | |
| echo "Waiting for Photon... ($i/30)" | |
| sleep 2 | |
| done | |
| - name: Run actions | |
| working-directory: typescript-client | |
| run: npm run test:actions | |
| - name: Run instructions | |
| working-directory: typescript-client | |
| run: npm run test:instructions |