Initial commit #8
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: API tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run API tests with pytest and generate Allure results | |
run: | | |
pytest -m regression --alluredir=allure-results --numprocesses 2 | |
- name: Upload Allure results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: allure-results | |
path: allure-results | |
publish-report: | |
needs: [ run-tests ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Download Allure results | |
uses: actions/download-artifact@v4 | |
with: | |
name: allure-results | |
path: allure-results | |
- name: Allure Report action from marketplace | |
uses: simple-elf/allure-report-action@v1.12 | |
if: always() | |
with: | |
allure_results: allure-results | |
allure_history: allure-history | |
- name: Deploy report to Github Pages | |
if: always() | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: allure-history |