-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (69 loc) · 2.08 KB
/
main.yml
File metadata and controls
69 lines (69 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out repository
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest-cov
pip install webdriver-manager
- name: Install Allure
run: |
wget https://github.com/allure-framework/allure2/releases/download/2.25.0/allure-2.25.0.zip
unzip allure-2.25.0.zip
export PATH=$PATH:$(pwd)/allure-2.25.0/bin
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Run test with Allure
env:
PYTHONPATH: .
run: |
mkdir -p allure-results
pytest test/ --alluredir=allure-results -v
- name: Generate Allure report
run: |
allure generate allure-results -o allure-report --clean
- name: Upload Allure report
uses: actions/upload-artifact@v4
with:
name: allure-report
path: allure-report/
- name: Run test with HTML
env:
PYTHONPATH: .
run: |
mkdir -p reports
pytest test/ --html=reports/report.html --self-contained-html
- name: Upload HTML test report
uses: actions/upload-artifact@v4
with:
name: html-report
path: reports/report.html
- name: Run test with Coverage
env:
PYTHONPATH: .
run: |
pytest test/ --cov=pages --cov-report=xml:coverage.xml --cov-report=html:htmlcov -v
- name: Upload Coverage HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-html-report
path: htmlcov/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true