Skip to content

Commit 19f489f

Browse files
committed
Add pytest workflow
1 parent b249c0f commit 19f489f

File tree

6 files changed

+77
-114
lines changed

6 files changed

+77
-114
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: build allure python
22

3-
on: [push, pull_request]
3+
on: [workflow_dispatch]
44

55
jobs:
66
build:

.github/workflows/pytest.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: build and test allure-pytest
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
linters:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.10"
18+
19+
- name: Install packages
20+
run: pip install build &&
21+
python -m build allure-python-commons &&
22+
python -m build allure-python-commons-test &&
23+
pip install allure-python-commons*/dist/allure-python-commons*.tar.gz &&
24+
pip install ./allure-pytest &&
25+
pip install -r allure-pytest/requirements.txt
26+
27+
- name: Static check allure-pytest
28+
working-directory: allure-pytest
29+
run: flake8 src/ test/
30+
31+
build:
32+
runs-on: ubuntu-latest
33+
needs: [linters]
34+
strategy:
35+
matrix:
36+
python-version: ["3.10", 3.9, 3.8, 3.7]
37+
env:
38+
ALLURE_INDENT_OUTPUT: yep
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v4
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Install packages
48+
run: pip install build &&
49+
python -m build allure-python-commons &&
50+
python -m build allure-python-commons-test &&
51+
pip install allure-python-commons*/dist/allure-python-commons*.tar.gz &&
52+
pip install ./allure-pytest &&
53+
pip install -r allure-pytest/requirements.txt
54+
55+
- name: Test allure-python
56+
working-directory: allure-pytest
57+
run: pytest --alluredir=allure-results --basetemp=tmp
58+
test/acceptance test/integration

allure-pytest/.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length = 120
3+
import-order-style = google
4+
inline-quotes = "

allure-pytest/requirements.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# test requirements
2+
pyhamcrest
3+
mock
4+
pytest-check
5+
pytest-flakes
6+
pytest-rerunfailures
7+
pytest-xdist
8+
pytest-lazy-fixture
9+
10+
# linters
11+
flake8==4.*
12+
flake8-builtins

allure-pytest/test/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from contextlib import contextmanager
88
from allure_commons.logger import AllureMemoryLogger
99

10+
pytest_plugins = "pytester"
11+
1012

1113
def pytest_configure(config):
1214
config.addinivalue_line(

allure-pytest/tox.ini

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)