Skip to content

Commit

Permalink
chore: update lighthouse and smoketest
Browse files Browse the repository at this point in the history
  • Loading branch information
balakrishna-deriv committed Nov 3, 2023
1 parent c80b4ba commit 63ef9e0
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
message: |
Running Lighthouse audit...
- name: Capture preview URL
id: capture-preview-url
id: capture_preview_url
uses: deriv-com/capture-url-from-issue-comment@v1.0.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -37,7 +37,7 @@ jobs:
uses: treosh/lighthouse-ci-action@v9
with:
urls: |
${{ steps.capture-preview-url.outputs.url }}
${{ steps.capture_preview_url.outputs.url }}
uploadArtifacts: true
temporaryPublicStorage: true
runs: 5
Expand Down
120 changes: 60 additions & 60 deletions .github/workflows/smoketests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,68 @@ permissions:
pull-requests: write
statuses: write

on:
on:
issue_comment:
types: [edited]
types: [created]

jobs:
cypress-run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [1,2,3,4,5]
cypress-run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5]

steps:
- name: Capture preview URL
id: capture_preview_url
uses: deriv-com/capture-url-from-issue-comment@v1.0.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout external repository with Cypress tests
uses: actions/checkout@v4
with:
repository: deriv-com/e2e-deriv-com

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v6
with:
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: true
parallel: true # Runs test in parallel using settings above
spec: cypress/e2e/smoke/*.js
group: 'Smoke Tests'

steps:
- name: Capture Vercel preview URL
id: vercel_preview_url
uses: binary-com/vercel-preview-url-action@v1.0.5
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout external repository with Cypress tests
uses: actions/checkout@v4
with:
repository: deriv-com/e2e-deriv-com
env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# 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 }}
# Send PR details to Cypress test run
COMMIT_INFO_MESSAGE: PR "${{ github.event.issue.number }}" in Repo "${{ github.repository }}" (v2)

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v6
with:
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: true
parallel: true # Runs test in parallel using settings above
spec: cypress/e2e/smoke/*.js
group: 'Smoke Tests'

env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# 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.vercel_preview_url.outputs.vercel_preview_url }}
# Send PR details to Cypress test run
COMMIT_INFO_MESSAGE: PR "${{ github.event.issue.number }}" in Repo "${{ github.repository }}" (v2)
- name: Set comments message
id: set_msg
if: always()
run: |
# Using shell script to conditionally set the message
if [[ "${{ job.status }}" == "success" ]]; then
echo "msg=:rocket: Smoke test run (${{ matrix.containers }}) passed successfully!" >> $GITHUB_OUTPUT
else
echo "msg=:x: Smoke test run (${{ matrix.containers }}) failed. See logs for details: [Visit Action](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}})" >> $GITHUB_OUTPUT
fi
- name: Set comments message
id: set_msg
if: always()
run: |
# Using shell script to conditionally set the message
if [[ "${{ job.status }}" == "success" ]]; then
echo "msg=:rocket: Smoke test run (${{ matrix.containers }}) passed successfully!" >> $GITHUB_OUTPUT
else
echo "msg=:x: Smoke test run (${{ matrix.containers }}) failed. See logs for details: [Visit Action](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}})" >> $GITHUB_OUTPUT
fi
- name: Leave comment
if: always()
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Smoke tests status update
number: ${{ github.event.issue.number }}
message: "${{ steps.set_msg.outputs.msg }}"
recreate: true
- name: Leave comment
if: always()
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Smoke tests status update
number: ${{ github.event.issue.number }}
message: '${{ steps.set_msg.outputs.msg }}'
recreate: true

0 comments on commit 63ef9e0

Please sign in to comment.