Merge pull request #691 from Brain-up/issue_268 #897
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test-pull_requests | |
| on: | |
| push: | |
| # workflow_dispatch | |
| # schedule: | |
| # - cron: '0 0 * * *' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 # Обновлено с v3 до v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 # Обновлено с v3 до 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 | |
| - 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@v2 # Обновлено с v2 до v4 - вернула 2 | |
| env: | |
| PERSONAL_TOKEN: ${{ secrets.CI_TOKEN }} | |
| PUBLISH_BRANCH: gh-pages | |
| PUBLISH_DIR: allure-history | |
| continue-on-error: true | |
| message: # Исправлено: было messsage (опечатка) | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Send message to Telegram | |
| uses: appleboy/telegram-action@master | |
| with: | |
| to: ${{ secrets.CHAT_ID }} | |
| token: ${{ secrets.TELEGRAM_TOKEN }} | |
| args: Last pull request report https://brain-up.github.io/auto-tests-python/ | |
| continue-on-error: true |