-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yml
56 lines (55 loc) · 1.59 KB
/
action.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
name: 'Anchor Test'
description: 'An "anchor test" action that runs in ~1 minute.'
branding:
icon: anchor
color: blue
inputs:
node-version:
description: 'Version of node.js to use'
required: false
default: '20.11.0' # LTS
solana-cli-version:
description: 'Version of Solana CLI to use'
required: false
default: '1.17.1' # stable
anchor-version:
description: 'Version of Anchor to use'
required: false
default: '0.29.0' # latest
features:
description: 'Features to pass to cargo'
required: false
default: 'default'
runs:
using: 'composite'
steps:
- uses: metadaoproject/setup-anchor@v2
with:
node-version: ${{ inputs.node-version }}
solana-cli-version: ${{ inputs.solana-cli-version }}
anchor-version: ${{ inputs.anchor-version }}
- name: Cache node_modules
uses: actions/cache@v3
with:
path: ./node_modules/
key: node-modules-${{ runner.os }}-build-${{ inputs.node-version }}
- name: Install node_modules
run: yarn
shell: bash
- name: Create keypair
run: solana-keygen new --no-bip39-passphrase
shell: bash
- name: Make Anchor.toml compatible with runner
run: sed -i 's:/user/:/runner/:' Anchor.toml
shell: bash
- name: Install Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustc
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Run tests
run: anchor test -- --features ${{ inputs.features }}
shell: bash