-
Notifications
You must be signed in to change notification settings - Fork 53
69 lines (60 loc) · 1.93 KB
/
solana.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
name: Solana CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- dev
jobs:
solana-sbf:
name: Solana Cargo SBF
runs-on: ubuntu-latest
container: backpackapp/build:v0.29.0
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v3
- name: Get rust toolchain version
id: toolchain
run: |
RUST_VERSION="$(awk '/channel =/ { print substr($3, 2, length($3)-2) }' solana/rust-toolchain)"
echo "::set-output name=version::${RUST_VERSION}"
- name: Cache rust toolchain
uses: actions/cache@v3
env:
cache-name: solana-toolchain
with:
path: |
~/.cargo/bin
~/.rustup
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ steps.toolchain.outputs.version }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@55c7845fad90d0ae8b2e83715cb900e5e861e8cb
with:
toolchain: ${{ steps.toolchain.outputs.version }}
components: "clippy,rustfmt"
- name: Run `cargo fmt`
run: cargo fmt --check --all --manifest-path solana/Cargo.toml
working-directory: ./solana
- name: Run `cargo check`
run: cargo check --workspace --tests --manifest-path solana/Cargo.toml
working-directory: ./solana
- name: Run `cargo clippy`
run: cargo clippy --workspace --tests --manifest-path solana/Cargo.toml
working-directory: ./solana
- name: make build
run: make build
working-directory: ./solana
- name: cargo test-sbf
env:
RUST_BACKTRACE: "1"
run: cargo test-sbf
working-directory: ./solana
- name: make anchor-test
run: make anchor-test
working-directory: ./solana