-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (82 loc) · 2.7 KB
/
program-tests.yml
File metadata and controls
95 lines (82 loc) · 2.7 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Program Tests
on:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: "-D warnings"
jobs:
program-tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- program: create-and-update
sub-tests: '[
"cargo test-sbf -p create-and-update"
]'
- program: counter-anchor
sub-tests: '[
"cargo test-sbf -p counter --manifest-path counter/anchor/Cargo.toml",
"cd counter/anchor && npm install && npm test"
]'
- program: counter-native
sub-tests: '[
"cargo test-sbf -p counter --manifest-path counter/native/Cargo.toml"
]'
- program: counter-pinocchio
sub-tests: '[
"cargo test-sbf -p counter --manifest-path counter/pinocchio/Cargo.toml"
]'
- program: account-comparison
sub-tests: '[
"cargo test-sbf -p account-comparison --manifest-path account-comparison/Cargo.toml"
]'
name: Test ${{ matrix.program }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "23.5.0"
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Solana CLI
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana-keygen new --no-bip39-passphrase
- name: Install Light CLI
run: |
npm install -g @lightprotocol/zk-compression-cli
- name: Generate Solana keypair
run: |
- name: Start Light test validator
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
light test-validator
- name: Run tests
run: |
SUB_TESTS='${{ matrix.sub-tests }}'
for test in $(echo $SUB_TESTS | jq -r '.[]'); do
echo "Running: $test"
eval $test
done