Skip to content

Commit

Permalink
Merge pull request #42 from sanosuke009/poc_sroy
Browse files Browse the repository at this point in the history
Refactored the workflow to produce tests from 3 jobs in a single Allure report
  • Loading branch information
sanosuke009 committed Mar 18, 2023
2 parents 46be375 + b8a12d0 commit 45c0c46
Showing 1 changed file with 42 additions and 86 deletions.
128 changes: 42 additions & 86 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Project Poseidon

on:
push:
branches: [ "master", "dev_sroy" ]
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 * * *'
Expand Down Expand Up @@ -43,52 +43,15 @@ jobs:
if: always()
uses: actions/upload-artifact@master
with:
name: allure-results
name: allure-results-ubuntu
path: allure-results/*
retention-days: 30

ubuntu-generate-allure-report:
name: Ubuntu Generate Allure Report
runs-on: ubuntu-latest
if: always()
needs: [ ubuntu-youtube-catapi-tests ]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
id: download
with:
name: allure-results
path: allure-results
- 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

windows-youtube-catapi-tests:
name: Windows - Test Youtube & Cat API
runs-on: windows-latest
if: always()
needs: [ ubuntu-generate-allure-report ]
needs: [ ubuntu-youtube-catapi-tests ]
steps:
- name: Checking out
uses: actions/checkout@v3
Expand Down Expand Up @@ -116,52 +79,15 @@ jobs:
if: always()
uses: actions/upload-artifact@master
with:
name: allure-results
name: allure-results-windows
path: allure-results/*
retention-days: 30

windows-generate-allure-report:
name: Windows Generate Allure Report
runs-on: ubuntu-latest
if: always()
needs: [ windows-youtube-catapi-tests ]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
id: download
with:
name: allure-results
path: allure-results
- 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

macos-youtube-catapi-tests:
name: MacOS - Test Youtube & Cat API
runs-on: macos-latest
if: always()
needs: [ windows-generate-allure-report ]
needs: [ windows-youtube-catapi-tests ]
steps:
- name: Checking out
uses: actions/checkout@v3
Expand All @@ -186,22 +112,52 @@ jobs:
if: always()
uses: actions/upload-artifact@master
with:
name: allure-results
name: allure-results-macos
path: allure-results
retention-days: 30

macos-generate-allure-report:
name: MacOS Generate Allure Report
generate-allure-report:
name: Generate Allure Report
runs-on: ubuntu-latest
if: always()
needs: [ macos-youtube-catapi-tests ]
steps:
- name: Download Artifacts
- name: Download Artifacts from Ubuntu
uses: actions/download-artifact@v3
id: download
id: download-ubuntu
with:
name: allure-results
path: allure-results
name: allure-results-ubuntu
path: allure-results-ubuntu
- name: Download Artifacts from Windows
uses: actions/download-artifact@v3
id: download-windows
with:
name: allure-results-windows
path: allure-results-windows
- name: Download Artifacts from MacOS
uses: actions/download-artifact@v3
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()
Expand Down

0 comments on commit 45c0c46

Please sign in to comment.