-
Notifications
You must be signed in to change notification settings - Fork 32
67 lines (63 loc) · 1.69 KB
/
ci_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
name: Rust SDK CI
on:
pull_request:
paths-ignore:
- "docs/**"
- "README.md"
- "LICENSE"
- ".editorconfig"
branches:
- master
- develop
- staging
- feat/protocol-fee-part-of-lp-fees
env:
SOLANA_CLI_VERSION: 1.16.3
RUST_TOOLCHAIN_VERSION: 1.76.0
jobs:
changed_files_rust:
runs-on: ubuntu-latest
outputs:
program: ${{steps.changed-files-specific.outputs.any_changed}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/[email protected]
with:
files: |
rust-client
programs
dynamic-amm-quote
rust-test:
needs: changed_files_rust
runs-on: ubuntu-latest
if: needs.changed_files_rust.outputs.program == 'true'
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-dep
- uses: ./.github/actions/setup-solana
# Install rust + toolchain
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
components: clippy
# Cargo build cache
- name: Cargo Cache
uses: actions/cache@v1
with:
path: |
~/.cargo/
target
key: ${{ runner.os }}-cargo-${{ steps.extract_branch.outputs.branch }}
restore-keys: |
${{ runner.os }}-cargo-${{ steps.extract_branch.outputs.branch }}
${{ runner.os }}-cargo
- name: Cargo fmt check
run: cargo fmt -- --check
shell: bash
- name: Cargo test
run: cargo test -- --nocapture
shell: bash