Add zk-nullifier example and reorganize zk/ folder #159
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: "2.3.11" | |
| RUST_TOOLCHAIN: "1.90.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/create-nullifier | |
| - basic-operations/anchor/update | |
| - basic-operations/anchor/close | |
| - basic-operations/anchor/reinit | |
| 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" | |
| - name: Install dependencies | |
| working-directory: ${{ matrix.example }} | |
| run: npm install | |
| - name: Build and sync program ID | |
| working-directory: ${{ matrix.example }} | |
| run: 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 | |
| test-zk: | |
| name: ZK ${{ matrix.example }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: | |
| - zk/zk-id | |
| - zk/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: "true" | |
| - name: Setup ZK circuits | |
| working-directory: ${{ matrix.example }} | |
| run: ./scripts/setup.sh | |
| - name: Install dependencies | |
| working-directory: ${{ matrix.example }} | |
| run: npm install | |
| - name: Build program | |
| working-directory: ${{ matrix.example }} | |
| run: cargo build-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: npm run test:ts |