-
Notifications
You must be signed in to change notification settings - Fork 51
166 lines (158 loc) · 4.86 KB
/
tests.yaml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
- develop
env:
SOLANA_CLI_VERSION: 1.16.13
NODE_VERSION: 18.12.1
jobs:
test-rust-lint:
name: Test Rust Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup/
- uses: actions/cache@v2
name: Cache Cargo registry + index
id: cache-cargo-build
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
- run: cargo fmt -- --check
- run: cargo clippy --all-targets -- -D warnings -A clippy::result_large_err -A clippy::too_many_arguments -A clippy::uninlined-format-args -A ambiguous_glob_reexports
test-unit:
name: Rust Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup/
- uses: actions/cache@v2
name: Cache Cargo registry + index
id: cache-cargo-build
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
- run: cargo test --lib
build:
name: Build Anchor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-anchor/
with:
testing: true
test-devflow:
needs: build
name: Test Development Workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-anchor/
with:
testing: true
- uses: ./.github/actions/setup-ts/
- name: Start Anchor Localnet
run: ~/.cargo/bin/anchor localnet --skip-build --provider.wallet ~/.config/solana/id.json & sleep 2
- name: Wait for localnet to start
run: |
while [[ "$(curl -s http://localhost:8899/health)" != "ok" ]]; do
echo "Waiting for local Anchor network to start..."
sleep 5
done
- name: Run bootstrap script
run: ./scripts/bootstrap.sh
test-docker-builds:
needs: build
name: Test Docker Builds
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test:
- utils/ecc-sig-verifier
- packages/monitor-service
- packages/faucet-service
- packages/metadata-service
- packages/distributor-oracle
- packages/account-postgres-sink-service
- packages/active-device-oracle
- packages/fanout-metadata-service
- packages/tokens-to-rent-service
- packages/rewards-oracle-faucet-service
- packages/vsr-metadata-service
steps:
- uses: actions/checkout@v3
- run: cd $DOCKER_PATH && docker build .
env:
DOCKER_PATH: ${{ matrix.test }}
test-rust-builds:
needs: build
name: Test Rust Builds
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test:
- utils/ecc-sig-verifier
- utils/bulk-claim-rewards
- utils/hpl-utils
- utils/migration-tx-executor
- utils/vehnt
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-anchor/
with:
testing: true
- run: cd $RUST_PATH && cargo build
env:
RUST_PATH: ${{ matrix.test }}
test-contracts:
needs: build
name: Test Anchor Contracts
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test:
- tests/circuit-breaker.ts
- tests/data-credits.ts
- tests/distributor-oracle.ts
- tests/helium-entity-manager.ts
- tests/mobile-entity-manager.ts
- tests/lazy-distributor.ts
- tests/lazy-transactions.ts
- tests/treasury-management.ts
- tests/voter-stake-registry.ts
- tests/fanout.ts
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-anchor/
with:
testing: true
- uses: ./.github/actions/setup-ts/
- name: Start Anchor Localnet
run: ~/.cargo/bin/anchor localnet --skip-build --provider.wallet ~/.config/solana/id.json & sleep 2
- name: Wait for localnet to start
run: |
while [[ "$(curl -s http://localhost:8899/health)" != "ok" ]]; do
echo "Waiting for local Anchor network to start..."
sleep 5
done
- run: ANCHOR_WALLET=${HOME}/.config/solana/id.json yarn run ts-mocha -p ./tsconfig.test.json -t 1000000 --exit $TEST
env:
TESTING: true
TEST: ${{ matrix.test }}
ANCHOR_PROVIDER_URL: http://localhost:8899