Skip to content

Add zk-nullifier example and reorganize zk/ folder #170

Add zk-nullifier example and reorganize zk/ folder

Add zk-nullifier example and reorganize zk/ folder #170

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
- 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 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