-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (65 loc) · 2.1 KB
/
tests.yaml
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
name: Tests
on:
push:
branches:
- main
- stage
pull_request:
branches:
- '**'
jobs:
test:
name: Python tests
runs-on: ubuntu-latest
env:
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
CHIA_SIMULATOR_ROOT: ${{ github.workspace }}/.chia/simulator
BLOCKS_AND_PLOTS_VERSION: 0.35.0
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Python
uses: Chia-Network/actions/setup-python@main
with:
python-version: '3.10'
- name: Create virtual environment
uses: Chia-Network/actions/create-venv@main
id: create-venv
- name: Activate virtual environment
uses: Chia-Network/actions/activate-venv@main
with:
directories: ${{ steps.create-venv.outputs.activate-venv-directories }}
- name: Run poetry install
uses: Chia-Network/actions/poetry@main
with:
poetry-command: "install --with dev"
- name: Cache test blocks and plots
uses: actions/cache@v3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: 1
id: test-blocks-plots
with:
path: |
${{ github.workspace }}/.chia/blocks
${{ github.workspace }}/.chia/test-plots
key: ${{ env.BLOCKS_AND_PLOTS_VERSION }}
- name: Checkout test blocks and plots
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download ${{ env.BLOCKS_AND_PLOTS_VERSION }} -R Chia-Network/test-cache --archive=tar.gz -O - | tar xzf -
mkdir "${GITHUB_WORKSPACE}/.chia"
mv "${GITHUB_WORKSPACE}/test-cache-${{ env.BLOCKS_AND_PLOTS_VERSION }}/"* "${GITHUB_WORKSPACE}/.chia"
- name: Run Python tests
env:
MODE: dev
PYTHONPATH: ".:./chia-blockchain"
run: |
chia init
chia version
python -m pytest tests