Skip to content

Commit f3da62c

Browse files
author
Eran Davidovich
committed
Add pytest Github Action
1 parent 860d01f commit f3da62c

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

.github/workflows/docker-image.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
tags:
88
- "v*"
99

10-
pull_request:
11-
branches:
12-
- "main"
13-
1410
jobs:
1511
docker:
1612
runs-on: ubuntu-latest

.github/workflows/pytest.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: pytest
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ["3.7", "3.8", "3.9"]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install flake8 pytest
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
27+
- name: Lint with flake8
28+
run: |
29+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
30+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
32+
- name: Test with pytest
33+
run: |
34+
pytest

0 commit comments

Comments
 (0)