chore: bump to solana 3 #213
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: Anchor | |
| 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: "4.0.0-rc.0" | |
| RUST_TOOLCHAIN: "1.91.0" | |
| NODE_VERSION: "22" | |
| jobs: | |
| test-typescript: | |
| name: ${{ matrix.example }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: | |
| - counter/anchor | |
| - create-and-update | |
| - basic-operations/anchor/burn | |
| - basic-operations/anchor/create | |
| - basic-operations/anchor/update | |
| - basic-operations/anchor/close | |
| - basic-operations/anchor/reinit | |
| - zk/zk-id | |
| - zk/nullifier | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup environment | |
| uses: ./.github/actions/setup | |
| with: | |
| example: ${{ matrix.example }} | |
| node-version: ${{ env.NODE_VERSION }} | |
| solana-cli-version: ${{ env.SOLANA_CLI_VERSION }} | |
| rust-toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| photon-indexer: "true" | |
| install-circom: ${{ matrix.example == 'zk/zk-id' }} | |
| - name: Setup ZK circuits | |
| if: matrix.example == 'zk/zk-id' | |
| working-directory: ${{ matrix.example }} | |
| run: ./scripts/setup.sh | |
| - name: Install dependencies | |
| working-directory: ${{ matrix.example }} | |
| run: npm install | |
| - name: Build and sync program ID | |
| working-directory: ${{ matrix.example }} | |
| run: | | |
| # Anchor 1.0 verifies declare_id! matches the program keypair. Sync it, | |
| # then keep the hardcoded Light CPI signer (derived from the program ID | |
| # at compile time) in sync with the synced ID so the CPI signer check | |
| # in the light-system-program passes at runtime. | |
| anchor keys sync | |
| PROGRAM_ID=$(grep -A 10 '\[programs.localnet\]' Anchor.toml | grep '=' | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| echo "Synced program ID: $PROGRAM_ID" | |
| grep -rl 'derive_light_cpi_signer!' programs 2>/dev/null | while IFS= read -r f; do | |
| sed -i -E "s/derive_light_cpi_signer!\(\"[^\"]*\"\)/derive_light_cpi_signer!(\"$PROGRAM_ID\")/g" "$f" | |
| done | |
| anchor build | |
| - name: Test sbf | |
| working-directory: ${{ matrix.example }} | |
| run: cargo test-sbf | |
| - name: Start test validator | |
| working-directory: ${{ matrix.example }} | |
| run: | | |
| PROGRAM_NAME=$(grep -A 10 '\[programs.localnet\]' Anchor.toml | grep '=' | head -1 | cut -d' ' -f1) | |
| PROGRAM_ID=$(grep -A 10 '\[programs.localnet\]' Anchor.toml | grep '=' | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| light test-validator --sbf-program "$PROGRAM_ID" ./target/deploy/${PROGRAM_NAME}.so & | |
| sleep 10 | |
| - name: Run TypeScript tests | |
| working-directory: ${{ matrix.example }} | |
| run: anchor test --skip-local-validator --skip-build --skip-deploy |