Skip to content

Commit

Permalink
Merge branch 'master' into f-remove-unnecessary-api-calls-when-loadin…
Browse files Browse the repository at this point in the history
…g-chart
  • Loading branch information
akmal-deriv committed Jun 20, 2023
2 parents 244d245 + a036558 commit 736e934
Show file tree
Hide file tree
Showing 1,828 changed files with 110,353 additions and 139,302 deletions.
38 changes: 32 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ commands:
- "packages/stores/node_modules"
- "packages/trader/node_modules"
- "packages/translations/node_modules"
- "packages/utils/node_modules"
# VERIFY_CACHE_FOLDERS_END (DO NOT REMOVE)

build:
Expand Down Expand Up @@ -178,15 +179,17 @@ commands:
jobs:
build:
docker:
- image: cimg/node:16.16.0
- image: cimg/node:18.16.0
resource_class: xlarge
steps:
- git_checkout_from_cache
- npm_install_from_cache
- build

release_staging:
docker:
- image: cimg/node:16.16.0
- image: cimg/node:18.16.0
resource_class: xlarge
steps:
- git_checkout_from_cache
- npm_install_from_cache
Expand All @@ -205,7 +208,8 @@ jobs:

release_production:
docker:
- image: cimg/node:16.16.0
- image: cimg/node:18.16.0
resource_class: xlarge
steps:
- git_checkout_from_cache
- npm_install_from_cache
Expand All @@ -226,7 +230,7 @@ jobs:

publish_cloudflare_staging:
docker:
- image: circleci/node:16.13.1-stretch
- image: cimg/node:18.16.0
steps:
- attach_workspace:
at: packages
Expand All @@ -236,7 +240,7 @@ jobs:

publish_cloudflare_production:
docker:
- image: circleci/node:16.13.1-stretch
- image: cimg/node:18.16.0
steps:
- attach_workspace:
at: packages
Expand All @@ -246,10 +250,32 @@ jobs:

build_and_test:
docker:
- image: cimg/node:16.16.0
- image: cimg/node:18.16.0
resource_class: xlarge
steps:
- git_checkout_from_cache
- npm_install_from_cache
- run:
name: "Check TypeScript for @deriv/api"
command: npx tsc --project packages/api/tsconfig.json -noEmit
- run:
name: "Check TypeScript for @deriv/hooks"
command: npx tsc --project packages/hooks/tsconfig.json -noEmit
- run:
name: "Check TypeScript for @deriv/utils"
command: npx tsc --project packages/utils/tsconfig.json -noEmit
- run:
name: "Check TypeScript for @deriv/stores"
command: npx tsc --project packages/stores/tsconfig.json -noEmit
# - run:
# name: "Check TypeScript for @deriv/cashier"
# command: npx tsc --project packages/cashier/tsconfig.json -noEmit
- run:
name: "Check tests for @deriv/hooks"
command: bash ./scripts/check-tests.sh packages/hooks/src
- run:
name: "Check tests for @deriv/utils"
command: bash ./scripts/check-tests.sh packages/utils/src
- build
- run:
name: "Run tests"
Expand Down
33 changes: 3 additions & 30 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,7 @@
## Changes:

Please include a summary of the change and which issue is fixed below:
- ...
Please provide a summary of the change.

## When you need to add unit test
### Screenshots:

- [ ] If this change disrupt current flow
- [ ] If this change is adding new flow

## When you need to add integration test

- [ ] If components from external libraries are being used to define the flow, e.g. @deriv/components
- [ ] If it relies on a very specific set of props with no default behavior for the current component.

## Test coverage checklist (for reviewer)

- [ ] Ensure utility / function has a test case
- [ ] Ensure all the tests are passing

## Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Update feature
- [ ] Refactor code
- [ ] Translation to code
- [ ] Translation to crowdin
- [ ] Script configuration
- [ ] Improve performance
- [ ] Style only
- [ ] Dependency update
- [ ] Documentation update
- [ ] Release
Please provide some screenshots of the change.
20 changes: 20 additions & 0 deletions .github/workflows/automationrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"skip_pending_checks": false,
"skip_slack_integration": false,
"skip_updating_branch": true,
"merge_delay": 120000,
"first_merge_delay": 1200000,
"max_task_count": 15,
"pull_request": {
"checks_timeout": 60000,
"refetch_timeout": 10000,
"refetch_limit": 20,
"checks_limit": 40
},
"circleci": {
"project_slug": "gh/binary-com/deriv-app",
"branch": "master",
"workflow_name": "release_staging"
},
"checks_to_skip": ["/gitguardian/i"]
}
6 changes: 3 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 18.x
- name: install, bootstrap and make test coverage
run: |
npm install
npm run bootstrap
npm run build:all
npm run test:jest
npm run test:jest 4
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_and_push_deriv_api_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id: step1
uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "18"
check-latest: true
registry-url: "https://registry.npmjs.org"
env:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/merge_and_release_to_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Merge and release to staging
permissions:
pull-requests: write
on:
workflow_dispatch:
inputs:
tag:
description: "Tag"
required: true
skip_circleci_checks:
description: "Skip checking CircleCI workflow"
type: boolean
required: false
skip_pending_checks:
description: "Skip waiting for pull request checks"
type: boolean
required: false

concurrency:
group: release_automation_group

jobs:
release_issues:
permissions: write-all
runs-on: ubuntu-latest
timeout-minutes: 600
steps:
- name: Checkout to repo
uses: actions/checkout@v3
with:
ref: master
- name: Setup node
uses: actions/setup-node@v2
- name: Wait for logs to accumulate
run: |
sleep 10
- name: Release issues in Deriv.app
uses: binary-com/fe-toolbox@production_V20230615_0
with:
tag: ${{ inputs.tag }}
platform: 'Deriv.app'
list_id: ${{ secrets.LIST_ID }}
release_tags_list_id: ${{ secrets.RELEASE_TAGS_LIST_ID }}
regression_testing_template_id: ${{ secrets.REGRESSION_TESTING_TEMPLATE_ID }}
config_path: ./.github/workflows/automationrc.json
skip_circleci_checks: ${{ inputs.skip_circleci_checks }}
skip_pending_checks: ${{ inputs.skip_pending_checks }}
CIRCLECI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }}
CLICKUP_API_TOKEN: ${{ secrets.CLICKUP_API_TOKEN }}
SLACK_APP_TOKEN: ${{ secrets.SLACK_APP_TOKEN }}
SLACK_USER_TOKEN: ${{ secrets.SLACK_USER_TOKEN }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/push_and_pull_crowdin_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Setup node
uses: actions/setup-node@v2
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
permissions:
issues: write
pull-requests: write

name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity. Please reopen it if needed.'
close-pr-message: 'This PR was closed because it has been stalled for 5 days with no activity. Please reopen it if needed.'
days-before-stale: 60
days-before-close: 5
ascending: true
operations-per-run: 200

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

This repository contains the various platforms of the Deriv application.

![CircleCI](https://img.shields.io/circleci/build/github/binary-com/deriv-app) ![Prerequisite](https://img.shields.io/badge/node-%3E%3D16.16.0-blue.svg) ![Prerequisite](https://img.shields.io/badge/npm-%3E%3D7.21.0-blue.svg) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
![CircleCI](https://img.shields.io/circleci/build/github/binary-com/deriv-app) ![Prerequisite](https://img.shields.io/badge/node-18.x-blue.svg) ![Prerequisite](https://img.shields.io/badge/npm-9.x-blue.svg)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
![Sonar Tech Debt](https://img.shields.io/sonar/tech_debt/binary-com_deriv-app?server=https%3A%2F%2Fsonarcloud.io)
![Sonar Violations (short format)](https://img.shields.io/sonar/violations/binary-com_deriv-app?server=https%3A%2F%2Fsonarcloud.io)
[![codecov](https://codecov.io/gh/binary-com/deriv-app/branch/dev/graph/badge.svg?token=LClg2rlZ4z)](https://codecov.io/gh/binary-com/deriv-app)
Expand Down
6 changes: 5 additions & 1 deletion end-to-end-test/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ ENDPOINT=<YOUR DESIRED ENDPOINT (QABOX ADDRESS)>
APP_URL=<APP URL(FOR LOCAL MACHINES SHOULD BE `https://localhost.binary.sx`>
QA_EMAIL_INBOX_USER_NAME=<QABOX EVENTS PAGE USERNAME (YOU CAN FIND IN `fe-shared` LASTPASS FOLDER) to sign in on `qaxx.deriv.dev/events`>
QA_EMAIL_INBOX_PASSWORD = <QABOX EVENTS PAGE PASSWORD (YOU CAN FIND IN `fe-shared` LASTPASS FOLDER) to sign in on `qaxx.deriv.dev/events`>
ACCOUNT_RESIDENCE=<COUNTRY NAME TO SET RESIDENCY OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Germany`)>
ACCOUNT_RESIDENCE_HIGH_RISK=<COUNTRY NAME TO SET RESIDENCY OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Germany`)>
ACCOUNT_CITIZENSHIP_HIGH_RISK=<COUNTRY NAME TO SET CITIZENSHIP OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Germany`)>
ACCOUNT_RESIDENCE_LOW_RISK=<COUNTRY NAME TO SET RESIDENCY OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Ecuador`)>
ACCOUNT_CITIZENSHIP_LOW_RISK=<COUNTRY NAME TO SET CITIZENSHIP OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Ecuador`)>
RISK_LEVEL=low_risk # This stores the risk level that can be either high_risk or low_risk
2 changes: 1 addition & 1 deletion end-to-end-test/.github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
Expand Down
14 changes: 11 additions & 3 deletions end-to-end-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ To run the End to End test you need to first install playwright on your machine

then

`npx plauwright test` to start the tests to run. (You also can pass `--debug` option to this command to it to run them in headless browser and check them visually separated by different browsers eg. Chromium, Firefox or Edge)
`npx playwright test` to start the tests to run. (You also can pass `--debug` option to this command to it to run them in headless browser and check them visually separated by different browsers eg. Chromium, Firefox or Edge)

`npm run test:e2e` to run the tests from within the root `directory`.

`npm run test:e2e-dev` to run the tests from within the root `directory` with trace enabled and show the test report.

## Project structure

Expand All @@ -30,8 +34,12 @@ It's mandatory to create this file to pass the needed environment variables to t
| 5 | `ENDPOINT` | Endpoint of qabox server | String | \* |
| 6 | `APP_URL` | App URL which tests should run on. Local machine URL is `localhost.binary.sx` | String | \* |
| 7 | `QA_EMAIL_INBOX_USER_NAME` | Username of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* |
| 8 | QA_EMAIL_INBOX_PASSWORD | Password of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* |
| 9 | ACCOUNT_RESIDENCE | Account residence to create account using it | String | \* |
| 8 | `QA_EMAIL_INBOX_PASSWORD` | Password of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* |
| 9 | `ACCOUNT_RESIDENCE_HIGH_RISK` | Account residence to use when creating high risk accounts it | String | \* |
| 10 | `ACCOUNT_RESIDENCE_LOW_RISK` | Account residence to use when creating low risk accounts | String | \* |
| 11 | `ACCOUNT_CITIZENSHIP_HIGH_RISK` | Account citizenship to use when creating high risk accounts | String | \* |
| 12 | `ACCOUNT_CITIZENSHIP_LOW_RISK` | Account citizenship to use when creating low risk accounts | String | \* |
| 13 | `RISK_LEVEL` | Risk level for the particular account i.e. high risk or low risk | String | \* |

### `onboarding.ts` file

Expand Down
Loading

0 comments on commit 736e934

Please sign in to comment.