Skip to content

Commit

Permalink
Merge branch 'master' into likhith/kyc-195/display-idv-error-messages
Browse files Browse the repository at this point in the history
  • Loading branch information
likhith-deriv committed Nov 7, 2023
2 parents 0c989c1 + 03e7bce commit b1bc752
Show file tree
Hide file tree
Showing 524 changed files with 12,275 additions and 6,849 deletions.
182 changes: 0 additions & 182 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
excludedFiles: '**/integration-tests/**/*.[jt]s?(x)',
extends: ['plugin:testing-library/react'],
},
{
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/publish_to_pages_test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: publish_to_pages_test
description: Publish to cloudflare pages (Test)
inputs:
CLOUDFLARE_ACCOUNT_ID:
description: 'Cloudflare account id'
required: true
CLOUDFLARE_API_TOKEN:
description: 'Cloudflare token'
required: true
runs:
using: composite
steps:
- name: Publish to cloudflare pages (test)
env:
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ inputs.CLOUDFLARE_API_TOKEN }}
run: |
npm i wrangler@3.1.0
cd packages/core
npx wrangler pages deploy dist/ --project-name=deriv-app-pages --branch=test
echo "New website - http://test.cf-pages-deriv-app.deriv.com"
shell: bash
29 changes: 29 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deriv App Integration Test Workflow
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
integration_tests:
name: Run Integration Tests
runs-on: Runner_16cores_Deriv-app
environment: Preview
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: "./.github/actions/setup_node"
- name: Install dependencies
uses: "./.github/actions/npm_install_from_cache"
- name: Invalidate NPM Cache
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: "./.github/actions/invalidate_npm_cache"
- name: Build
run: npm run build:all
- name: Install Playwright Browsers
run: npx playwright install
- name: Run integration tests
run: npm run test:e2e
41 changes: 41 additions & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deriv App Release to Test environment Workflow
on:
push:
branches:
- master

jobs:
build_test_and_publish:
name: Build, Test and Publish to Cloudflare Test
runs-on: Runner_16cores_Deriv-app
environment: Staging
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: "./.github/actions/setup_node"
- name: Install Dependencies
uses: "./.github/actions/npm_install_from_cache"
- name: Build
uses: "./.github/actions/build"
with:
NODE_ENV: staging
DATADOG_APPLICATION_ID: ${{ vars.DATADOG_APPLICATION_ID }}
DATADOG_CLIENT_TOKEN: ${{ vars.DATADOG_CLIENT_TOKEN }}
DATADOG_CLIENT_TOKEN_LOGS: ${{ vars.DATADOG_CLIENT_TOKEN_LOGS }}
DATADOG_SESSION_REPLAY_SAMPLE_RATE: ${{ vars.DATADOG_SESSION_REPLAY_SAMPLE_RATE }}
DATADOG_SESSION_SAMPLE_RATE: ${{ vars.DATADOG_SESSION_SAMPLE_RATE }}
DATADOG_SESSION_SAMPLE_RATE_LOGS: ${{ vars.DATADOG_SESSION_SAMPLE_RATE_LOGS }}
GD_API_KEY: ${{ secrets.GD_API_KEY }}
GD_APP_ID: ${{ secrets.GD_APP_ID }}
GD_CLIENT_ID: ${{ secrets.GD_CLIENT_ID }}
RUDDERSTACK_STAGING_KEY: ${{ vars.RUDDERSTACK_STAGING_KEY }}
RUDDERSTACK_URL: ${{ vars.RUDDERSTACK_URL }}
REF_NAME: ${{ github.ref_name }}
- name: Run tests
run: npm test
- name: Publish to Cloudflare Pages Test
uses: "./.github/actions/publish_to_pages_test"
with:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
79 changes: 79 additions & 0 deletions .github/workflows/smoketests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
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: Runner_16cores_Deriv-app
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/t*.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 }}

- 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
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name: Deriv App Test Workflow
name: Deriv App PR Test Workflow
on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build_and_test:
name: Build And Test
runs-on: Runner_16cores_Deriv-app
environment: Preview
steps:
- name: Checkout
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: "./.github/actions/setup_node"
Expand Down
Loading

0 comments on commit b1bc752

Please sign in to comment.