[BOT] shafin/BOT-869/fix google drive showing connected even on abort action #7895
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
name: Run Smoke Tests - Deriv app | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
deployments: write | |
pull-requests: write | |
statuses: write | |
on: | |
issue_comment: | |
types: [edited] | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
containers: [1,2] | |
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-app | |
- 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.E2E_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 }}" | |
# Set login env variables | |
E2E_OAUTH_URL: ${{ secrets.E2E_OAUTH_URL }} | |
E2E_CONFIG_APPID: ${{ secrets.E2E_CONFIG_APPID }} | |
E2E_CONFIG_SERVER: ${{ secrets.E2E_CONFIG_SERVER }} | |
E2E_MT5_LOGIN: ${{ secrets.E2E_MT5_LOGIN }} | |
E2E_MT5_PASSWORD: ${{ secrets.E2E_MT5_PASSWORD }} | |
E2E_MT5_BASEURL: ${{ secrets.E2E_MT5_BASEURL }} | |
- 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 |