add tests tc_005_001_013 - tc_005_001_015 #56
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
download-history: | |
name: Download history | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Get previous run artifact | |
run: > | |
ARTIFACT_ID=$(curl -L | |
-H "Accept: application/vnd.github+json" | |
-H "X-GitHub-Api-Version: 2022-11-28" | |
"https://api.github.com/repos/py-AQA/LumaProjectPython_2024_spring/actions/artifacts?name=allure-results" | |
| python -c "import sys, json; print(json.load(sys.stdin)['artifacts'][0]['id']);") | |
&& | |
curl -L | |
-H "Accept: application/vnd.github+json" | |
-H "Authorization: Bearer ${{ secrets.TOKEN }}" | |
-H "X-GitHub-Api-Version: 2022-11-28" | |
https://api.github.com/repos/py-AQA/LumaProjectPython_2024_spring/actions/artifacts/$ARTIFACT_ID/zip | |
-o artifacts.zip && | |
REPORT_ID=$(curl -L | |
-H "Accept: application/vnd.github+json" | |
-H "X-GitHub-Api-Version: 2022-11-28" | |
"https://api.github.com/repos/py-AQA/LumaProjectPython_2024_spring/actions/artifacts?name=github-pages" | |
| python -c "import sys, json; print(json.load(sys.stdin)['artifacts'][0]['id']);") | |
&& | |
curl -L | |
-H "Accept: application/vnd.github+json" | |
-H "Authorization: Bearer ${{ secrets.TOKEN }}" | |
-H "X-GitHub-Api-Version: 2022-11-28" | |
https://api.github.com/repos/py-AQA/LumaProjectPython_2024_spring/actions/artifacts/$REPORT_ID/zip | |
-o pages.zip | |
- run: mkdir allure-results && unzip artifacts.zip -d allure-results | |
- run: mkdir old_pages pages_history && unzip pages.zip -d old_pages && tar -xvf old_pages/artifact.tar -C pages_history | |
- run: cp pages_history/history/* allure-results && cp -r pages_history/history allure-results | |
- name: Store allure history | |
uses: actions/upload-artifact@v3 | |
with: | |
name: allure-results | |
path: | |
allure-results | |
retention-days: 1 | |
run-test: | |
name: 'Run tests' | |
needs: download-history | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
pytest | |
env: | |
CI_RUN: true | |
PYTHONDONTWRITEBYTECODE: 1 | |
PYTHONUNBUFFERED: 1 | |
continue-on-error: true | |
- name: Store allure results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: allure-results | |
path: | |
allure-results | |
retention-days: 1 | |
generate-report: | |
runs-on: ubuntu-latest | |
needs: run-test | |
name: Generate report | |
steps: | |
- name: Install JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '17' | |
- name: Install allure | |
run: | | |
sudo wget https://github.com/allure-framework/allure2/releases/download/2.29.0/allure-2.29.0.tgz && sudo tar -zxvf allure-2.29.0.tgz -C /opt/ && sudo ln -s /opt/allure-2.29.0/bin/allure /usr/bin/allure | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v3 | |
- name: Run allure generate | |
run: | | |
allure generate -c allure-results -o _site | |
- name: Store generated report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: _site | |
path: | |
_site | |
retention-days: 1 | |
publish-report: | |
runs-on: ubuntu-latest | |
needs: generate-report | |
name: Report publication | |
steps: | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v3 | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v2 | |
- name: Deploy to gitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1.2.9 | |