-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (65 loc) · 1.89 KB
/
ci-pr-main-program.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
name: Locker
on:
pull_request:
branches:
- main
- staging
env:
SOLANA_CLI_VERSION: 1.18.21
NODE_VERSION: 18.14.2
ANCHOR_CLI_VERSION: 0.30.1
jobs:
program_changed_files:
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: |
programs/locker
locker_unit_test:
runs-on: ubuntu-latest
needs: program_changed_files
if: needs.program_changed_files.outputs.program == 'true'
steps:
- uses: actions/checkout@v2
# Install rust + toolchain
- run: rustup toolchain install stable --component clippy
# Cache rust, cargo
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1"
- run: cargo test --package locker
shell: bash
locker_anchor_test:
runs-on: ubuntu-latest
needs: program_changed_files
if: needs.program_changed_files.outputs.program == 'true'
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-solana
- uses: ./.github/actions/setup-dep
- uses: ./.github/actions/setup-anchor
# Install rust + toolchain
- run: rustup toolchain install stable --component clippy
# Cache rust, cargo
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1"
# Cache node_modules
- uses: actions/cache@v2
id: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-${{ hashFiles('./package-lock.json') }}
- run: npm install
shell: bash
- run: sed -i -E 's/, *"cli"//g' Cargo.toml && rm -f Cargo.toml-E
- run: anchor test -- --features localnet
shell: bash