Skip to content

Commit c00f5e3

Browse files
author
Roman
committed
add unit and integration tests wf
1 parent e08282b commit c00f5e3

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Unit and integration tests checker
2+
permissions:
3+
contents: read
4+
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened, edited]
8+
9+
jobs:
10+
unit-and-integration-tests:
11+
if: github.event.pull_request.draft == false
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
max-parallel: 5
17+
matrix:
18+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.11"
28+
29+
- name: Cache venv
30+
id: cache
31+
uses: actions/cache@v4
32+
with:
33+
path: venv
34+
key: v2-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
35+
36+
- name: Install deps
37+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
38+
run: |
39+
python -m venv venv
40+
source venv/bin/activate
41+
python -m pip install --upgrade pip
42+
python -m pip install uv
43+
python -m uv sync --extra dev --active
44+
45+
- name: Unit tests
46+
timeout-minutes: 20
47+
env:
48+
PYTHONUNBUFFERED: "1"
49+
run: |
50+
source venv/bin/activate
51+
python -m uv run pytest -n 2 tests/unit_tests/ --reruns 3
52+
53+
- name: Integration tests
54+
timeout-minutes: 20
55+
env:
56+
PYTHONUNBUFFERED: "1"
57+
run: |
58+
source venv/bin/activate
59+
python -m uv run pytest -n 2 tests/integration_tests/ --reruns 3

0 commit comments

Comments
 (0)