Skip to content

Commit 26dc51d

Browse files
author
tilo-14
committed
fix ci
1 parent 9a9d9d0 commit 26dc51d

File tree

6 files changed

+14
-59
lines changed

6 files changed

+14
-59
lines changed

.github/workflows/rust-tests.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ jobs:
2929
- counter/native
3030
- counter/pinocchio
3131
- account-comparison
32-
- zk/zk-id
33-
- zk/zk-nullifier
34-
- zk/zk-merkle-proof
3532
- airdrop-implementations/simple-claim/program
3633
include:
3734
- example: basic-operations/native
@@ -53,12 +50,6 @@ jobs:
5350
example: ${{ matrix.example }}
5451
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
5552
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
56-
install-circom: ${{ startsWith(matrix.example, 'zk/') || startsWith(matrix.example, 'zk/') }}
57-
58-
- name: Setup ZK circuits
59-
if: startsWith(matrix.example, 'zk/') || startsWith(matrix.example, 'zk/')
60-
working-directory: ${{ matrix.example }}
61-
run: ./scripts/setup.sh
6253

6354
- name: Build and test
6455
working-directory: ${{ matrix.example }}

.github/workflows/typescript-tests.yml

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
- basic-operations/anchor/update
3535
- basic-operations/anchor/close
3636
- basic-operations/anchor/reinit
37+
- zk/zk-id
38+
- zk/nullifier
3739
steps:
3840
- uses: actions/checkout@v4
3941

@@ -45,6 +47,12 @@ jobs:
4547
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
4648
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
4749
photon-indexer: "true"
50+
install-circom: ${{ matrix.example == 'zk/zk-id' }}
51+
52+
- name: Setup ZK circuits
53+
if: matrix.example == 'zk/zk-id'
54+
working-directory: ${{ matrix.example }}
55+
run: ./scripts/setup.sh
4856

4957
- name: Install dependencies
5058
working-directory: ${{ matrix.example }}
@@ -69,49 +77,3 @@ jobs:
6977
- name: Run TypeScript tests
7078
working-directory: ${{ matrix.example }}
7179
run: anchor test --skip-local-validator --skip-build --skip-deploy
72-
73-
test-zk:
74-
name: ZK ${{ matrix.example }}
75-
runs-on: ubuntu-latest
76-
strategy:
77-
fail-fast: false
78-
matrix:
79-
example:
80-
- zk/zk-id
81-
- zk/zk-nullifier
82-
steps:
83-
- uses: actions/checkout@v4
84-
85-
- name: Setup environment
86-
uses: ./.github/actions/setup
87-
with:
88-
example: ${{ matrix.example }}
89-
node-version: ${{ env.NODE_VERSION }}
90-
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
91-
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
92-
photon-indexer: "true"
93-
install-circom: "true"
94-
95-
- name: Setup ZK circuits
96-
working-directory: ${{ matrix.example }}
97-
run: ./scripts/setup.sh
98-
99-
- name: Install dependencies
100-
working-directory: ${{ matrix.example }}
101-
run: npm install
102-
103-
- name: Build program
104-
working-directory: ${{ matrix.example }}
105-
run: cargo build-sbf
106-
107-
- name: Start test validator
108-
working-directory: ${{ matrix.example }}
109-
run: |
110-
PROGRAM_NAME=$(grep -A 10 '\[programs.localnet\]' Anchor.toml | grep '=' | head -1 | cut -d' ' -f1)
111-
PROGRAM_ID=$(grep -A 10 '\[programs.localnet\]' Anchor.toml | grep '=' | head -1 | sed 's/.*"\(.*\)".*/\1/')
112-
light test-validator --sbf-program "$PROGRAM_ID" ./target/deploy/${PROGRAM_NAME}.so &
113-
sleep 10
114-
115-
- name: Run TypeScript tests
116-
working-directory: ${{ matrix.example }}
117-
run: npm run test:ts

zk/nullifier/Anchor.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ cluster = "localnet"
1616
wallet = "~/.config/solana/id.json"
1717

1818
[scripts]
19-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
19+
test = "npm run test"
2020

zk/nullifier/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"setup": "./scripts/setup.sh",
77
"clean": "./scripts/clean.sh",
88
"compile": "circom circuits/nullifier.circom --r1cs --wasm --sym -o build",
9-
"test:ts": "ts-mocha -p ./tsconfig.json -t 1000000 ts-tests/*.test.ts"
9+
"test:ts": "ts-mocha -p ./tsconfig.json -t 1000000 ts-tests/*.test.ts",
10+
"test": "ts-mocha -p ./tsconfig.json -t 1000000 ts-tests/*.test.ts"
1011
},
1112
"dependencies": {
1213
"circomlib": "2.0.5",

zk/zk-id/Anchor.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ cluster = "localnet"
1616
wallet = "~/.config/solana/id.json"
1717

1818
[scripts]
19-
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
19+
test = "npm run test"

zk/zk-id/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"generate-zkey": "snarkjs groth16 setup build/compressed_account_merkle_proof.r1cs pot/powersOfTau28_hez_final_16.ptau build/circuit_0000.zkey",
1111
"contribute": "snarkjs zkey contribute build/circuit_0000.zkey build/circuit_final.zkey --name='First contribution' -v",
1212
"export-vkey": "snarkjs zkey export verificationkey build/circuit_final.zkey build/verification_key.json",
13-
"test:ts": "ts-mocha -p ./tsconfig.json -t 1000000 ts-tests/*.test.ts"
13+
"test:ts": "ts-mocha -p ./tsconfig.json -t 1000000 ts-tests/*.test.ts",
14+
"test": "ts-mocha -p ./tsconfig.json -t 1000000 ts-tests/*.test.ts"
1415
},
1516
"dependencies": {
1617
"@coral-xyz/borsh": "^0.30.1",

0 commit comments

Comments
 (0)