generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 45
61 lines (51 loc) · 1.57 KB
/
test-programs.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
name: Test Programs
on:
workflow_call:
inputs:
program_matrix:
type: string
env:
CACHE: true
jobs:
test_programs:
name: Test
runs-on: ubuntu-latest-16-cores
strategy:
matrix:
program: ${{ fromJson(inputs.program_matrix) }}
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV
- name: Install Rust
uses: metaplex-foundation/actions/install-rust@v1
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install Solana
uses: metaplex-foundation/actions/install-solana@v1
with:
version: ${{ env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
- name: Cache program dependencies
if: env.CACHE == 'true'
uses: metaplex-foundation/actions/cache-program@v1
with:
folder: ./programs/${{ matrix.program }}
key: program-${{ matrix.program }}
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./programs/${{ matrix.program }}/Cargo.toml -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features --no-deps --manifest-path ./programs/${{ matrix.program }}/Cargo.toml
- name: Run tests
shell: bash
working-directory: configs/scripts/program
run: RUST_LOG=error ./test.sh
env:
PROGRAM: ${{ matrix.program }}