Python autotests with Allure #6
This file contains 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: Python autotests with Allure | |
on: | |
workflow_dispatch: | |
inputs: | |
deployment_target: | |
description: choose tests set | |
required: true | |
type: choice | |
default: smoke | |
options: | |
- smoke | |
- regression | |
- all | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
name: Run autotests | |
steps: | |
- name: Run autotests | |
uses: actions/checkout@v4 | |
- name: Set up Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11.1' | |
- name: Pip Upgrade | |
run: python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: | |
pip install -r requirements.txt | |
- name: Run all tests | |
if: "github.event.inputs.deployment_target == 'all'" | |
run: pytest --alluredir=allure-results | |
continue-on-error: true | |
- name: Run smoke tests | |
if: "github.event.inputs.deployment_target == 'smoke'" | |
run: pytest -m smoke --alluredir=allure-results | |
continue-on-error: true | |
- name: Run regression tests | |
if: "github.event.inputs.deployment_target == 'regression'" | |
run: pytest -m regression --alluredir=allure-results | |
continue-on-error: true | |
- name: Install Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'microsoft' | |
java-version: '17' | |
- name: Install Allure | |
run: sudo wget https://github.com/allure-framework/allure2/releases/download/2.30.0/allure-2.30.0.tgz && sudo tar -zxvf allure-2.30.0.tgz -C /opt/ && sudo ln -s /opt/allure-2.30.0/bin/allure /usr/bin/allure | |
- name: Add Executor And Categories in Allure Results | |
run: cp -r categories.json executor.json allure-results/ | |
- name: Generate Report | |
run: allure generate allure-results --clean -o allure-report | |
- name: Save Allure Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: allure-report | |
path: allure-report | |
retention-days: 1 |