Repository navigation
109 lines (96 loc) · 3.63 KB
/
Copy pathpull_request_report.yml
File metadata and controls
109 lines (96 loc) · 3.63 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Test-pull_requests
on:
push:
# workflow_dispatch
# schedule:
# - cron: '0 0 * * *'
permissions:
contents: write
jobs:
build:
# Зафиксирована версия, чтобы убрать уведомления о миграции ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests
env:
LOGIN: ${{ secrets.LOGIN }}
PASSWORD: ${{ secrets.PASSWORD }}
CHANGE_PASSWORD_EMAIL: ${{ secrets.CHANGE_PASSWORD_EMAIL }}
CHANGE_PASSWORD: ${{ secrets.CHANGE_PASSWORD }}
PASSWORD_EMAIL: ${{ secrets.PASSWORD_EMAIL }}
PASSWORD_LINK: ${{ secrets.PASSWORD_LINK }}
SPECIALIST_LOGIN: ${{ secrets.SPECIALIST_LOGIN }}
DEFAULT_LOGIN: ${{ secrets.DEFAULT_LOGIN }}
AUTH_URL: ${{ secrets.AUTH_URL }}
DELETE_USER: ${{ secrets.DELETE_USER }}
run: |
pytest -s -v --alluredir=allure-results
continue-on-error: true
- name: Add allure information
working-directory: allure-results
if: always()
run: |
echo GIT_BRANCH=${{ github.head_ref || github.ref_name }} >> environment.properties
echo GIT_COMMIT_ID=${{ github.sha }} >> environment.properties
echo GIT_COMMIT_MESSAGE=$(git show -s --format=%s HEAD) >> environment.properties
echo GIT_COMMIT_AUTHOR_NAME=$(git show -s --format='%ae' HEAD) >> environment.properties
echo GIT_COMMIT_TIME=$(git show -s --format=%ci HEAD) >> environment.properties
echo CHROME_VERSION=$(google-chrome --product-version) >> environment.properties
continue-on-error: true
# Новый шаг: сохраняем результаты тестов как артефакт (использует upload-artifact@v7)
- name: Upload Allure results
if: always()
uses: actions/upload-artifact@v7
with:
name: allure-results
path: allure-results/
retention-days: 7
- name: Get Allure history
uses: actions/checkout@v4
if: always()
with:
ref: gh-pages
path: gh-pages
continue-on-error: true
- name: Allure Report action
uses: simple-elf/allure-report-action@master
if: always()
with:
allure_results: allure-results
allure_history: allure-history
keep_reports: 50
continue-on-error: true
- name: Commit Allure report
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.CI_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
continue-on-error: true
message:
needs: build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Send message to Telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: Last pull request report https://brain-up.github.io/auto-tests-python/
continue-on-error: true