Skip to content

Commit 4b104fd

Browse files
committed
ci: adding workflow for testing purposes
1 parent aea2dc2 commit 4b104fd

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/qa-test.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Pytest test
2+
run-name: Pytest test - ${{ github.ref_name }}
3+
4+
on:
5+
push:
6+
branches:
7+
- "test-v*"
8+
9+
# Cancel previous runs on the same branch to save resources
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
# General Build/Test Settings
16+
RUST_PROFILE: release
17+
SLOW_MACHINE: 1
18+
VALGRIND: 0
19+
COMPILER: gcc
20+
21+
# Network and DB Settings
22+
TEST_NETWORK: regtest
23+
TEST_DB_PROVIDER: sqlite3
24+
25+
# Test Runner Settings
26+
TEST_DEBUG: 1
27+
PYTEST_OPTS: --timeout=1200 --durations=10
28+
PYTEST_PAR: 10 # Number of parallel tests, adjust based on runner size if needed
29+
30+
jobs:
31+
run-tests:
32+
name: Build and Test
33+
runs-on: ubuntu-22.04
34+
timeout-minutes: 60
35+
36+
steps:
37+
- name: Checkout Code
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Set up Python 3.10
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: "3.10"
46+
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v5
49+
50+
- name: Install System Dependencies
51+
# setup.sh installs libraries needed to compile CLN
52+
run: |
53+
bash -x .github/scripts/setup.sh
54+
sudo apt-get update -qq
55+
56+
- name: Install Bitcoind
57+
# Essential for integration tests. Uses env vars to determine version/network.
58+
run: .github/scripts/install-bitcoind.sh
59+
60+
- name: Configure CLN
61+
# We enable debug and rust, disable valgrind for speed on personal forks
62+
run: |
63+
./configure --enable-debugbuild --enable-developer --enable-rust --disable-valgrind
64+
65+
- name: Build CLN
66+
# Build in parallel using available processors
67+
run: |
68+
uv run make -j $(nproc)
69+
70+
- name: Run Pytest
71+
# uses eatmydata for FS speed, runs parallel tests via xdist (-n)
72+
run: |
73+
uv run eatmydata pytest tests/ -vvv -n ${{ env.PYTEST_PAR }} ${{ env.PYTEST_OPTS }}

0 commit comments

Comments
 (0)