-
Notifications
You must be signed in to change notification settings - Fork 5
146 lines (124 loc) · 4.5 KB
/
functional.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Run functional tests
on:
pull_request:
merge_group:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
permissions: {}
jobs:
lint:
name: Lint test files
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: "^3.10" # Keep in sync with `pyproject.toml`
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: functional-tests/.venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
working-directory: functional-tests
#if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' # this was giving issues in cache
run: poetry install --no-root --no-interaction
- name: Check formatting
working-directory: functional-tests
run: poetry run ruff format --check
- name: Lint
working-directory: functional-tests
run: poetry run ruff check
run:
name: Run functional tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cleanup Space
uses: ./.github/actions/cleanup # zizmor: ignore[unpinned-uses]
- name: Install bitcoind
env:
BITCOIND_VERSION: "28.1"
BITCOIND_ARCH: "x86_64-linux-gnu"
SHASUM: "07f77afd326639145b9ba9562912b2ad2ccec47b8a305bd075b4f4cb127b7ed7"
run: |
curl -fsSLO --proto "=https" --tlsv1.2 "https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-$BITCOIND_ARCH.tar.gz"
sha256sum -c <<< "$SHASUM bitcoin-$BITCOIND_VERSION-$BITCOIND_ARCH.tar.gz"
tar xzf "bitcoin-$BITCOIND_VERSION-$BITCOIND_ARCH.tar.gz"
sudo install -m 0755 -t /usr/local/bin bitcoin-"$BITCOIND_VERSION"/bin/*
bitcoind --version
rm -rf "bitcoin-$BITCOIND_VERSION" "bitcoin-$BITCOIND_VERSION-$BITCOIND_ARCH.tar.gz"
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: "^3.10" # Keep in sync with `pyproject.toml`
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: functional-tests/.venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
working-directory: functional-tests
#if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' # this was giving issues in cache
run: poetry install --no-root --no-interaction
- name: Set up Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-07-27
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Build Cargo project
run: cargo build --locked -F debug-utils
- name: Run functional tests (1)
id: funcTestsRun1
continue-on-error: true
run: |
NEWPATH="$(realpath target/debug/)"
export PATH="${NEWPATH}:${PATH}"
which strata-client
cd functional-tests && poetry run python entry.py
# Run again just to be sure as some tests are flaky
- name: Run functional tests (2)
if: steps.funcTestsRun1.outcome == 'failure'
run: |
NEWPATH="$(realpath target/debug/)"
export PATH="${NEWPATH}:${PATH}"
which strata-client
cd functional-tests && poetry run python entry.py
functional-tests-success:
name: Check that all checks pass
runs-on: ubuntu-latest
if: always()
needs: [lint, run]
timeout-minutes: 60
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}