Skip to content

Fix the failing Github Actions workflow : In Progress #7837

Fix the failing Github Actions workflow : In Progress

Fix the failing Github Actions workflow : In Progress #7837

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Project Poseidon
on:
push:
branches: [ "master", "dev_sroy", "poc_sroy" ]
pull_request:
branches: [ "master" ]
#schedule: ## At every 30th minute past every hour from 2 through 10. Schedule the job to run at 4.am daily. '0 4 * * *'
# - cron: '*/30 2-10 * * *'
permissions:
contents: write
jobs:
ubuntu-youtube-catapi-tests:
name: Ubuntu - Test Youtube & Cat API
runs-on: ubuntu-latest
steps:
- name: Checking out
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install the browsers for playwright
run: |
python -m playwright install --with-deps
- name: Test with pytest
env:
CAT_API_KEY: ${{ secrets.CAT_API_KEY }}
run: |
pytest web/src/test/testcases/youtube
pytest api/src/test/testcases/catAPI
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-ubuntu
path: allure-results/*
retention-days: 1
windows-youtube-catapi-tests:
name: Windows - Test Youtube & Cat API
runs-on: windows-latest
if: always()
needs: [ ubuntu-youtube-catapi-tests ]
steps:
- name: Checking out
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install the browsers for playwright
shell: pwsh
run: |
python -m playwright install --with-deps
- name: Test with pytest
shell: pwsh
env:
CAT_API_KEY: ${{ secrets.CAT_API_KEY }}
run: |
pytest api/src/test/testcases/catAPI
pytest web/src/test/testcases/youtube
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-windows
path: allure-results/*
retention-days: 1
macos-youtube-catapi-tests:
name: MacOS - Test Youtube & Cat API
runs-on: macos-latest
if: always()
needs: [ windows-youtube-catapi-tests ]
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install the browsers for playwright
run: |
python -m playwright install --with-deps
- name: Test with pytest
env:
CAT_API_KEY: ${{ secrets.CAT_API_KEY }}
run: |
pytest api/src/test/testcases/catAPI
pytest web/src/test/testcases/youtube
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-macos
path: allure-results
retention-days: 1
generate-allure-report:
name: Generate Allure Report
runs-on: ubuntu-latest
if: always()
needs: [ macos-youtube-catapi-tests ]
steps:
- name: Download Artifacts from Ubuntu
uses: actions/download-artifact@v4
id: download-ubuntu
with:
name: allure-results-ubuntu
path: allure-results-ubuntu
- name: Download Artifacts from Windows
uses: actions/download-artifact@v4
id: download-windows
with:
name: allure-results-windows
path: allure-results-windows
- name: Download Artifacts from MacOS
uses: actions/download-artifact@v4
id: download-macos
with:
name: allure-results-macos
path: allure-results-macos
- name: Copy Allure-Result Files from Ubuntu
uses: canastro/copy-file-action@master
with:
source: allure-results-ubuntu/.
target: allure-results/
flags: '-r'
- name: Copy Allure-Result Files from Windows
uses: canastro/copy-file-action@master
with:
source: allure-results-windows/.
target: allure-results/
flags: '-r'
- name: Copy Allure-Result Files from MacOS
uses: canastro/copy-file-action@master
with:
source: allure-results-macos/.
target: allure-results/
flags: '-r'
- name: Allure gh-page Checkout
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Setting Allure-Report Action
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages
allure_report: allure-report
allure_history: allure-history
keep_reports: 20
- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
# - name: Post the link to the report
# if: always()
# uses: Sibz/github-status-action@v1
# with:
# authToken: ${{secrets.GITHUB_TOKEN}}
# context: 'Test report'
# state: 'success'
# sha: ${{ github.event.pull_request.head.sha }}
# target_url: simple-elf.github.io/github-allure-history/${{ github.run_number }}