-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (75 loc) · 2.4 KB
/
test.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
name: Test
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
env:
solana_verion: 1.7.12
jobs:
install:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['yarn test']
steps:
- uses: actions/checkout@v2
- name: test
run: |
echo "${{ matrix.node }}"
- uses: actions/cache@v2
name: cache solana cli
id: cache-solana
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-${{ runner.os }}-v0000-${{ env.solana_verion }}
- uses: actions/cache@v2
name: cache target directory
id: cache-programs
with:
path: |
./target
key: solana-${{ runner.os }}-v0000-${{ hashFiles('**/programs/**/*.rs') }}-${{ hashFiles('**/programs/**/*.toml') }}
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: install essentials
run: |
sudo apt-get update
sudo apt-get install -y pkg-config build-essential libudev-dev
- name: install solana
if: steps.cache-solana.outputs.cache-hit != 'true'
run: |
sh -c "$(curl -sSfL https://release.solana.com/v${{ env.solana_verion }}/install)"
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
- name: setup solana
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana --version
solana-keygen new
- name: install anchor
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
npm install -g @project-serum/anchor-cli
- name: install node_modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
yarn install --ignore-scripts
- name: build programs
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
anchor build
- name: run tests
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
${{ matrix.node }}