-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (48 loc) · 1.47 KB
/
program-test.yml
File metadata and controls
55 lines (48 loc) · 1.47 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
name: Program Test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.14.13
RUST_TOOLCHAIN: stable
jobs:
build-and-test-program:
runs-on: ubuntu-latest
env:
cache_id: program-test
steps:
# Setup Deps
- uses: actions/checkout@v2
- uses: ./.github/actions/install-linux-build-deps
- uses: ./.github/actions/install-solana
with:
solana_version: ${{ env.SOLANA_VERSION }}
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
# Build program to create target folder.
- uses: ./.github/actions/build-program
# Restore Cache from previous build/test
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key:
${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{
env.RUSTC_HASH }}
# Run test
- name: test-program
id: run_test
working-directory: ./program
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir target/deploy/ -- --nocapture --test-threads 1