Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(ci): use two jobs for publishing reports #798

Merged
merged 7 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 24 additions & 26 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
playwright-report-desktop-chrome
playwright-report-mobile-chrome

publish-report:
publish-playwright-report:
if: always()
needs: merge-reports
runs-on: ubuntu-latest
Expand All @@ -124,13 +124,15 @@ jobs:
contents: write
issues: read
concurrency:
group: deploy-gh-pages-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
outputs:
playwright_report_url: ${{ steps.comment.outputs.playwright_report_url }}
steps:
- uses: actions/[email protected]
with:
repository: Satellite-im/test-reports
ref: gh-pages
path: gh-pages

- name: Download Merged Report
uses: actions/download-artifact@v4
Expand All @@ -143,24 +145,30 @@ jobs:
run: echo "timestamp=$(date --utc +%Y%m%d_%H%M%SZ)" >> "$GITHUB_OUTPUT"

- name: Deploy Playwright HTML report to Github Pages
if: success()
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: Satellite-im/test-reports
keep_files: true
publish_branch: gh-pages
publish_dir: ./playwright-report
destination_dir: ${{ steps.timestampidone.outputs.timestamp }}

- name: Stop ssh-agent job from first deploy required for deploying a second time
run: killall ssh-agent

- uses: actions/[email protected]
with:
repository: Satellite-im/test-reports
ref: gh-pages
- name: Set Playwright report URL output
id: comment
run: echo "playwright_report_url=https://satellite-im.github.io/test-reports/${{ steps.timestampidone.outputs.timestamp }}/" >> "$GITHUB_OUTPUT"

publish-allure-report:
needs: publish-playwright-report
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: write
issues: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Download Allure results artifact for desktop
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -188,9 +196,6 @@ jobs:
ref: gh-pages
path: gh-pages

- name: Pull changes from gh-pages
run: git pull --rebase origin gh-pages

- name: Generate Allure Report
if: always()
uses: simple-elf/allure-report-action@master
Expand All @@ -199,20 +204,13 @@ jobs:
allure_results: allure-results
allure_report: allure-report
allure_history: allure-history
keep_reports: 100
keep_reports: 20
github_repo: Satellite-im/test-reports
github_repo_owner: Satellite-im

- name: Set a timestamp two
id: timestampidtwo
run: echo "timestamp=$(date --utc +%Y%m%d_%H%M%SZ)" >> "$GITHUB_OUTPUT"

- name: Pull changes from gh-pages
run: git pull --rebase origin gh-pages

- name: Deploy report to Github Pages
if: success()
uses: peaceiris/actions-gh-pages@v4
if: always()
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: Satellite-im/test-reports
Expand All @@ -224,12 +222,12 @@ jobs:
uses: mshick/[email protected]
with:
message: |
Automated tests execution is complete! You can find the Playwright test report [here](https://satellite-im.github.io/test-reports/${{ steps.timestampidone.outputs.timestamp }}/) and the Allure Test Report [here](https://satellite-im.github.io/test-reports/${{ github.run_number }})
Automated tests execution is complete! You can find the Playwright test report [here](${{ needs.publish-playwright-report.outputs.playwright_report_url }}) and the Allure Test Report [here](https://satellite-im.github.io/test-reports/${{ github.run_number }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

remove-label:
needs: [playwright-run, merge-reports, publish-report]
needs: [playwright-run, merge-reports, publish-playwright-report, publish-allure-report]
runs-on: ubuntu-latest
permissions:
checks: write
Expand Down