-
Notifications
You must be signed in to change notification settings - Fork 18
108 lines (93 loc) · 3.11 KB
/
solana-rust.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
name: Solana Rust
on:
push:
paths:
- 'solana/program/**'
- 'solana/integration-lib/**'
- 'solana/Cargo.toml'
- 'solana/Cargo.lock'
- 'solana/Xargo.toml'
- '.github/**'
pull_request:
jobs:
solana-gateway-program-lint:
name: Lint the solana rust code on ${{ matrix.rust }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# This should match rust-toolchain.toml ( actions-rs/toolchain@v1 does not pick it up directly in monorepos )
rust: [ '1.69' ]
os: [ ubuntu-latest ]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
default: true
- name: Cache build dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./solana/target
key: cargo-lint-${{ hashFiles('solana/Cargo.lock') }}
- name: Run fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path solana/Cargo.toml --all -- --check
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests --features test-sbf --manifest-path solana/Cargo.toml -- --deny=warnings
solana-gateway-program-build:
name: Build and test the solana rust code on Solana ${{ matrix.solana }}, Rust ${{ matrix.rust }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [ '1.69' ] # This should match rust-toolchain.toml ( actions-rs/toolchain@v1 does not pick it up directly in monorepos )
solana: [ 'stable' ]
os: [ ubuntu-latest ]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true
- name: Cache build dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./solana/target
key: cargo-build-v2-${{ hashFiles('solana/Cargo.lock') }}
- name: Cache Solana version
uses: actions/cache@v2
with:
path: |
~/.cache
key: solana-${{ matrix.solana }}
- name: Install Solana
run: |
sh -c "$(curl -sSfL https://release.solana.com/${{ matrix.solana }}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path solana/Cargo.toml
- name: Build the program and run functional tests
uses: actions-rs/cargo@v1
with:
command: test-sbf
args: --manifest-path solana/Cargo.toml