forked from metaplex-foundation/metaplex
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (130 loc) · 4.18 KB
/
build-and-test.yml
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
name: Build and Test Rust Programs
on:
push:
branches: [master]
paths:
- 'rust/**'
pull_request:
branches: [master]
paths:
- 'rust/**'
env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.8.2
RUST_TOOLCHAIN: stable
jobs:
# -----------------
# Main Task: Build + Test
# -----------------
build-and-test:
runs-on: ubuntu-latest
needs:
- test-token-vault
- test-token-metadata
- test-metaplex
steps:
- run: echo "Done"
# -----------------
# Test Token Vault
# -----------------
test-token-vault:
runs-on: ubuntu-latest
env:
cache_id: test-token-vault-program
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 }}
# 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-token-vault-program
id: run_test
working-directory: ./rust/token-vault/program
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf -- --nocapture --test-threads 1
# -----------------
# Test Token Metadata
# -----------------
test-token-metadata:
runs-on: ubuntu-latest
env:
cache_id: test-token-metadata-program
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 }}
# 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 }}
# Build deps
- uses: ./.github/actions/build-token-vault
# Run test
- name: test-token-metadata-program
id: run_test
working-directory: ./rust/token-metadata/program
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf -- --nocapture --test-threads 1
test-metaplex:
runs-on: ubuntu-latest
env:
cache_id: test-metaplex
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 }}
# 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-metaplex
id: run_test
working-directory: ./rust/metaplex/program
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf -- --nocapture --test-threads 1