-
Notifications
You must be signed in to change notification settings - Fork 93
122 lines (106 loc) · 4.13 KB
/
sdk-tests.yml
File metadata and controls
122 lines (106 loc) · 4.13 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
on:
push:
branches:
- main
paths:
- "program-libs/**"
- "programs/**"
- "sdk-tests/**"
- "sdk-libs/**"
pull_request:
branches:
- "*"
paths:
- "programs/**"
- "program-libs/**"
- "sdk-tests/**"
- "sdk-libs/**"
types: [opened, synchronize, reopened, ready_for_review]
name: examples-tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
system-programs:
name: system-programs
if: false # Temporarily disabled for LiteSVM testing
runs-on: ubuntu-latest
timeout-minutes: 60
services:
redis:
image: redis:8.0.1
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
REDIS_URL: redis://localhost:6379
strategy:
matrix:
include:
- program: native
sub-tests: '["cargo-test-sbf -p sdk-native-test", "cargo-test-sbf -p sdk-v1-native-test", "cargo-test-sbf -p sdk-light-token-test", "cargo-test-sbf -p client-test"]'
- program: anchor & pinocchio
sub-tests: '["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk-compressible-test", "cargo-test-sbf -p csdk-anchor-derived-test", "cargo-test-sbf -p csdk-anchor-full-derived-test", "cargo-test-sbf -p sdk-pinocchio-v1-test", "cargo-test-sbf -p sdk-pinocchio-v2-test", "cargo-test-sbf -p pinocchio-nostd-test", "cargo-test-sbf -p single-mint-test", "cargo-test-sbf -p single-pda-test", "cargo-test-sbf -p single-ata-test", "cargo-test-sbf -p single-token-test"]'
- program: token test
sub-tests: '["cargo-test-sbf -p sdk-token-test"]'
- program: sdk-libs
packages: light-sdk-macros light-sdk light-program-test light-client light-token-types light-token
test_cmd: |
cargo test -p light-sdk-macros
cargo test -p light-sdk-macros --all-features
cargo test -p light-sdk
cargo test -p light-sdk --all-features
cargo test -p light-program-test
cargo test -p light-client
cargo test -p light-sparse-merkle-tree
cargo test -p light-token-types
cargo test -p light-token --all-features
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Setup and build
uses: ./.github/actions/setup-and-build
with:
skip-components: "redis,disk-cleanup,go"
cache-key: "rust"
- name: Build CLI
run: |
npx nx build @lightprotocol/zk-compression-cli
- name: Install bun
if: matrix.program == 'sdk-libs'
run: npm install -g bun
- name: Install CLI globally (npm, bun, yarn)
if: matrix.program == 'sdk-libs'
run: |
npm install -g @lightprotocol/zk-compression-cli
bun install -g @lightprotocol/zk-compression-cli
cd /tmp && yarn global add @lightprotocol/zk-compression-cli
- name: Test find_light_bin with npm
if: matrix.program == 'sdk-libs'
run: |
cargo test -p light-program-test --lib -- test_find_light_bin --nocapture
- name: Test find_light_bin with bun
if: matrix.program == 'sdk-libs'
run: |
PATH="$HOME/.bun/bin:$PATH" cargo test -p light-program-test --lib -- test_find_light_bin --nocapture
- name: Test find_light_bin with yarn
if: matrix.program == 'sdk-libs'
run: |
PATH="$(yarn global bin):$PATH" cargo test -p light-program-test --lib -- test_find_light_bin --nocapture
- name: Run sub-tests for ${{ matrix.program }}
if: matrix.sub-tests != null
run: |
IFS=',' read -r -a sub_tests <<< "${{ join(fromJSON(matrix.sub-tests), ', ') }}"
for subtest in "${sub_tests[@]}"
do
echo "$subtest"
eval "RUSTFLAGS=\"-D warnings\" $subtest"
done
- name: Run tests for ${{ matrix.program }}
if: matrix.test_cmd != null
run: |
${{ matrix.test_cmd }}