Skip to content

Commit

Permalink
feat: move test reports in separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Tyan committed Nov 20, 2024
1 parent a6ad332 commit 8e2a1bb
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions .github/workflows/pr-visual-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,33 @@ jobs:
with:
name: pr
path: ./pr-id.txt
- name: Create GitHub Comment
if: github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Extract PR Number
id: pr
run: echo "::set-output name=id::$(<pr/pr-id.txt)"
shell: bash
- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_KEY_ID }}
AWS_DEFAULT_REGION: ru-central1
AWS_EC2_METADATA_DISABLED: true
run: aws s3 cp playwright-report s3://diplodoc-playwright-reports/components/test-report/${{ steps.pr.outputs.id}}/ --endpoint-url=https://storage.yandexcloud.net --recursive
shell: bash
- name: Create Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.pr.outputs.id }}
header: visual tests report
message: '[Visual Tests Report](https://storage.yandexcloud.net/diplodoc-playwright-reports/components/test-report/${{ steps.pr.outputs.id }}/index.html) is ready.'
comment:
if: ${{ always() && github.event.workflow_run.event == 'pull_request'}}
needs: visual_tests
name: Create GitHub Comment
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Extract PR Number
id: pr
run: echo "::set-output name=id::$(<pr/pr-id.txt)"
shell: bash
- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_KEY_ID }}
AWS_DEFAULT_REGION: ru-central1
AWS_EC2_METADATA_DISABLED: true
run: aws s3 cp playwright-report s3://diplodoc-playwright-reports/components/test-report/${{ steps.pr.outputs.id}}/ --endpoint-url=https://storage.yandexcloud.net --recursive
shell: bash
- name: Create Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.pr.outputs.id }}
header: visual tests report
message: '[Visual Tests Report](https://storage.yandexcloud.net/diplodoc-playwright-reports/components/test-report/${{ steps.pr.outputs.id }}/index.html) is ready.'

0 comments on commit 8e2a1bb

Please sign in to comment.