-
Notifications
You must be signed in to change notification settings - Fork 58
129 lines (117 loc) · 3.92 KB
/
tests.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
solana_version: 1.14.17
anchor_version: 0.27.0
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [
"test_basic_0",
"test_basic_1",
"test_basic_2",
"test_basic_3",
"test_basic_3_bankrun",
"test_chat",
"test_cli",
"test_cli_init",
"test_composite",
"test_errors",
"test_events",
"test_misc",
"test_misc_core",
"test_misc_core_bankrun",
"test_multisig",
"test_pyth",
"test_zero_copy",
"client_gen/test_client_gen",
"client_gen/test_functional",
]
steps:
- name: Checkout repo.
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Cache Solana Tool Suite
uses: actions/cache@v2
id: cache-solana
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-${{ runner.os }}-v0000-${{ env.solana_version }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- name: Install Solana
if: steps.cache-solana.outputs.cache-hit != 'true'
run: sh -c "$(curl -sSfL https://release.solana.com/v${{ env.solana_version }}/install)"
- name: Add Solana to path
run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Anchor CLI
run: npm install -g @coral-xyz/anchor-cli@${{ env.anchor_version }}
- name: Check CLI Anchor installation
run: anchor -V
- name: Generate local keypair
run: solana-keygen new --no-bip39-passphrase
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
run: poetry install -E cli --no-interaction --no-root
#----------------------------------------------
# install your root project
#----------------------------------------------
- name: Install library
run: poetry install -E cli --no-interaction
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: poetry run pytest tests/${{ matrix.node }}.py
all_good:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest
needs: tests
steps:
- name: note that all tests succeeded
run: echo "🎉"