-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (67 loc) · 2.24 KB
/
typescript-tests.yml
File metadata and controls
78 lines (67 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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/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