This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bala/Change trigger for lighthouse and smoketest (#5869)
* chore: change workflows trigger * revert: translations auto lint * chore: remove pat token for adding comments
- Loading branch information
1 parent
60e8000
commit c6611ad
Showing
3 changed files
with
65 additions
and
33 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,35 +9,48 @@ permissions: | |
statuses: write | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
workflow_run: | ||
workflows: ['Generate preview link'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
generate_lighthouse_audit: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Download artifact | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow_conclusion: success | ||
run_id: ${{ github.event.workflow_run.id }} | ||
name: 'pr-${{ github.event.workflow_run.id }}' | ||
path: pr | ||
|
||
- name: Retrieve pull request | ||
id: pr_information | ||
run: | | ||
echo "issue_number=$(cat ./pr/NR)" >> $GITHUB_OUTPUT | ||
echo "preview_url=$(cat ./pr/PREVIEW_URL)" >> $GITHUB_OUTPUT | ||
- name: Add comment to PR | ||
id: loading_comment_to_pr | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
number: ${{ github.event.issue.number }} | ||
number: ${{ steps.pr_information.outputs.issue_number }} | ||
header: lighthouse | ||
message: | | ||
Running Lighthouse audit... | ||
- name: Capture preview URL | ||
id: capture_preview_url | ||
uses: deriv-com/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v3 | ||
- name: Audit preview URL with Lighthouse | ||
id: lighthouse_audit | ||
uses: treosh/lighthouse-ci-action@v9 | ||
with: | ||
urls: | | ||
${{ steps.capture_preview_url.outputs.url }} | ||
${{ steps.pr_information.outputs.preview_url }} | ||
uploadArtifacts: true | ||
temporaryPublicStorage: true | ||
runs: 5 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,35 @@ permissions: | |
statuses: write | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
workflow_run: | ||
workflows: ['Generate preview link'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
containers: [1, 2, 3, 4, 5] | ||
|
||
steps: | ||
- name: Capture preview URL | ||
id: capture_preview_url | ||
uses: deriv-com/[email protected] | ||
- name: Download artifact | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
workflow_conclusion: success | ||
run_id: ${{ github.event.workflow_run.id }} | ||
name: 'pr-${{ github.event.workflow_run.id }}' | ||
path: pr | ||
|
||
- name: Retrieve pull request | ||
id: pr_information | ||
run: | | ||
echo "issue_number=$(cat ./pr/NR)" >> $GITHUB_OUTPUT | ||
echo "preview_url=$(cat ./pr/PREVIEW_URL)" >> $GITHUB_OUTPUT | ||
- name: Checkout external repository with Cypress tests | ||
uses: actions/checkout@v4 | ||
|
@@ -50,9 +62,9 @@ jobs: | |
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
# Set Base Url from client_payload. | ||
CYPRESS_BASE_URL: ${{ steps.capture_preview_url.outputs.url }} | ||
CYPRESS_BASE_URL: ${{ steps.pr_information.outputs.preview_url }} | ||
# Send PR details to Cypress test run | ||
COMMIT_INFO_MESSAGE: PR "${{ github.event.issue.number }}" in Repo "${{ github.repository }}" (v2) | ||
COMMIT_INFO_MESSAGE: PR "${{ steps.pr_information.outputs.issue_number }}" in Repo "${{ github.repository }}" (v2) | ||
|
||
- name: Set comments message | ||
id: set_msg | ||
|
@@ -70,6 +82,6 @@ jobs: | |
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: Smoke tests status update | ||
number: ${{ github.event.issue.number }} | ||
number: ${{ steps.pr_information.outputs.issue_number }} | ||
message: '${{ steps.set_msg.outputs.msg }}' | ||
recreate: true |
c6611ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
deriv-com – ./
deriv-com-git-master.binary.sx
deriv-com.binary.sx