Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
swetha1654 committed Nov 29, 2024
1 parent d5b2168 commit 8e95738
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@
name: Run tests and publish report
name: Allure Report

on: [push]

jobs:
test:
autotests:
name: Run tests and generate Allure Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run tests
pip install -r requirements.txt
- name: Check code style
if: always()
run: |
pytest --verbose
flake8
- name: Load test report history
- name: Run Test
if: always()
run: pytest --alluredir=allure-results
continue-on-error: true

- name: Get Allure history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Build test report
- name: Allure Report action from marketplace
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_results: allure-results
allure_history: allure-history
allure_results: build/allure-results

- name: Publish test report
uses: peaceiris/actions-gh-pages@v3
- name: Deploy report to Github Pages
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --allure-link-pattern pr:https://github.com/swetha1654/allure-simple/pull/{}
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest>=5.0.0
allure-pytest>=2.8.18
flake8>=3.8.3

0 comments on commit 8e95738

Please sign in to comment.