-
Notifications
You must be signed in to change notification settings - Fork 96
75 lines (64 loc) · 1.58 KB
/
ci-code-review-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
name: Code Review - Rust
on:
push:
paths:
[
'programs/**',
'lib/client/**',
'Cargo.lock',
'.github/workflows/ci-code-review-rust.yml',
]
workflow_dispatch: # Pick branch manually
env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: '1.14.17'
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
override: true
- name: Run fmt
run: cargo fmt -- --check
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install just
uses: extractions/setup-just@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
profile: minimal
components: rustc
override: true
default: true
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
env-vars: 'SOLANA_VERSION'
- name: Install Solana
uses: metadaoproject/[email protected]
with:
solana-cli-version: $SOLANA_VERSION
- name: Create keypair
run: solana-keygen new --no-bip39-passphrase
shell: bash
- name: Run tests all deps
run: just test-all
shell: bash