Skip to content

Commit a495051

Browse files
committed
added pytest action
1 parent 044e6e5 commit a495051

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/pytest.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Tests on PR
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
python-version: [3.9, 3.10]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Cache pip dependencies
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.cache/pip
27+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
28+
restore-keys: |
29+
${{ runner.os }}-pip-
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install pytest
35+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
36+
37+
- name: Run tests with pytest
38+
run: |
39+
pytest --verbose --tb=short

0 commit comments

Comments
 (0)