Skip to content

Commit

Permalink
Merge branch 'master' into rostislav/wall-3096/fix-atm-input-amount-n…
Browse files Browse the repository at this point in the history
…ot-fitting
  • Loading branch information
rostislav-deriv committed Jan 3, 2024
2 parents a074c40 + ff643fe commit 31b861c
Show file tree
Hide file tree
Showing 980 changed files with 34,704 additions and 12,717 deletions.
14 changes: 11 additions & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inputs:
DATADOG_SESSION_REPLAY_SAMPLE_RATE:
description: 'Datadog session replay sample rate'
required: false
DATADOG_SESSION_SAMPLE_RATE:
DATADOG_SESSION_SAMPLE_RATE:
description: 'Datadog session sample rate'
required: false
GD_API_KEY:
Expand All @@ -33,12 +33,18 @@ inputs:
GD_APP_ID:
description: 'Google drive app id'
required: false
GD_CLIENT_ID:
GD_CLIENT_ID:
description: 'Google drive client id'
required: false
RUDDERSTACK_KEY:
description: 'Rudderstack key'
required: false
GROWTHBOOK_CLIENT_KEY:
description: 'Growthbook key'
required: false
GROWTHBOOK_DECRYPTION_KEY:
description: 'Growthbook decryption key'
required: false
DATADOG_SESSION_SAMPLE_RATE_LOGS:
description: 'Datadog session sample rate for logs'
required: false
Expand All @@ -50,7 +56,7 @@ runs:
env:
NODE_ENV: ${{ inputs.NODE_ENV }}
CROWDIN_WALLETS_API_KEY: ${{ inputs.CROWDIN_WALLETS_API_KEY }}
DATADOG_APPLICATION_ID: ${{ inputs.DATADOG_APPLICATION_ID }}
DATADOG_APPLICATION_ID: ${{ inputs.DATADOG_APPLICATION_ID }}
DATADOG_CLIENT_TOKEN: ${{ inputs.DATADOG_CLIENT_TOKEN }}
DATADOG_CLIENT_TOKEN_LOGS: ${{ inputs.DATADOG_CLIENT_TOKEN_LOGS }}
DATADOG_SESSION_REPLAY_SAMPLE_RATE: ${{ inputs.DATADOG_SESSION_REPLAY_SAMPLE_RATE }}
Expand All @@ -60,6 +66,8 @@ runs:
GD_APP_ID: ${{ inputs.GD_APP_ID }}
GD_CLIENT_ID: ${{ inputs.GD_CLIENT_ID }}
RUDDERSTACK_KEY: ${{ inputs.RUDDERSTACK_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ inputs.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ inputs.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ inputs.REF_NAME }}
run: npm run build:all
shell: bash
31 changes: 6 additions & 25 deletions .github/actions/send_slack_notifications/action.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
name: send_slack_notifications
description: Send Slack notifications
name: send_slack_notification
description: Send Slack notification
inputs:
SLACK_WEBHOOK_URL:
description: 'Slack webhook URL'
required: true
status:
description: 'Job status'
MESSAGE:
description: 'Status message'
required: true
release_type:
description: 'Release type'
required: true
version:
description: 'Version'
required: true
default: 'N/A'
runs:
using: composite
steps:
- name: Send Slack Notification on Success

if: inputs.status == 'success'
- name: Send Slack Notification
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{
"text": "${{ inputs.RELEASE_TYPE }} Release succeeded for app.deriv.com with version ${{ inputs.VERSION }}"
"text": "${{ inputs.MESSAGE }}"
}' \
${{ inputs.SLACK_WEBHOOK_URL }}
shell: bash

- name: Send Slack Notification on Failure
if: inputs.status == 'failure'
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{
"text": "${{ inputs.RELEASE_TYPE }} Release failed for app.deriv.com with version ${{ inputs.VERSION }}"
}' \
${{ inputs.SLACK_WEBHOOK_URL }}
shell: bash
18 changes: 14 additions & 4 deletions .github/workflows/push_and_pull_crowdin_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,28 @@ jobs:
- name: Checkout master branch
uses: actions/checkout@v2.3.4

- name: Import GPG key
id: import-gpg
uses: deriv-com/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

# In this step we're doing a couple things:
# - We generate a new messages.json
# - We hash the newly generated messages.json and compare it with the messages.json on Crowdin.
# - We download the latest translation files from Crowdin, if there are new files, we create a PR.
- name: Generate and push to Crowdin
env:
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}
run: |
branch_name="deriv_app_translations"
echo "Setting up Git identity"
git config --global user.name "DerivFE"
git config --global user.email "80095553+DerivFE@users.noreply.github.com"
echo "Installing Crowdin CLI and bootstrapping project"
sudo npm i -g @crowdin/cli
npm run bootstrap
Expand Down
69 changes: 53 additions & 16 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
tags:
- production_*
env:
RELEASE_TYPE: Production
jobs:
build_test_and_publish:
name: Build, Test and Publish to Cloudflare Pages Production
Expand All @@ -21,7 +23,7 @@ jobs:
uses: "./.github/actions/build"
with:
NODE_ENV: production
DATADOG_APPLICATION_ID: ${{ vars.DATADOG_APPLICATION_ID }}
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 }}
Expand All @@ -31,13 +33,15 @@ jobs:
GD_APP_ID: ${{ secrets.GD_APP_ID }}
GD_CLIENT_ID: ${{ secrets.GD_CLIENT_ID }}
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
- name: Run tests
run: npm test
- name: Versioning
uses: "./.github/actions/versioning"
with:
release_type: production
RELEASE_TYPE: ${{ env.RELEASE_TYPE }}
- name: Extract version
id: extract_version
run: echo "RELEASE_VERSION=${version}" >> $GITHUB_OUTPUT
Expand All @@ -46,20 +50,15 @@ jobs:
with:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Build Docker image and push to Docker hub and K8S
uses: "./.github/actions/build_and_push_docker_image"
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
K8S_NAMESPACE: ${{ secrets.K8S_NAMESPACE }}
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
CA_CRT: ${{ secrets.CA_CRT }}
APP_VERSION: latest
name: build
path: packages/core/dist
retention-days: 1

send_slack_notification:
name: Send Slack notification
name: Send Release Slack notification
runs-on: Runner_8cores_Deriv-app
environment: Production
if: always()
Expand All @@ -69,10 +68,48 @@ jobs:
uses: actions/checkout@v4
- name: Conclusion
uses: technote-space/workflow-conclusion-action@v3
- name: Create Slack Message
id: create_slack_message
run: |
if [ "${{ env.WORKFLOW_CONCLUSION }}" == "success" ]; then
echo "MESSAGE=${{ env.RELEASE_TYPE }} Release succeeded for app.deriv.com with version ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV
else
echo "MESSAGE=${{ env.RELEASE_TYPE }} Release failed for app.deriv.com with version ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV
fi
- name: Send Slack Notification
uses: "./.github/actions/send_slack_notifications"
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
status: ${{ env.WORKFLOW_CONCLUSION }}
release_type: Production
version: ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION}}
MESSAGE: ${{ steps.create_slack_message.outputs.MESSAGE }}

build_and_publish_to_docker_k8s:
name: Build Docker image and push to Docker hub and K8S
runs-on: Runner_8cores_Deriv-app
environment: Production
needs: [build_test_and_publish]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: build
path: packages/core/dist
- name: Build Docker image and push to Docker hub and K8S
id: build_and_push_docker_image
uses: "./.github/actions/build_and_push_docker_image"
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
K8S_NAMESPACE: ${{ secrets.K8S_NAMESPACE }}
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
CA_CRT: ${{ secrets.CA_CRT }}
APP_VERSION: latest
- name: Send Slack Notification on Docker Publish and Kubernetes Deployment Failure
if: ${{ steps.build_and_push_docker_image.outcome != 'success' }}
uses: "./.github/actions/send_slack_notifications"
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: "${{ env.RELEASE_TYPE }} Docker Publish and Kubernetes Deployment for app.deriv.com with version ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION }} has Failed"
10 changes: 6 additions & 4 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build_test_and_publish:
name: Build, Test and Publish to Cloudflare Staging
name: Build, Test and Publish to Cloudflare Staging
runs-on: Runner_16cores_Deriv-app
environment: Staging
steps:
Expand All @@ -21,7 +21,7 @@ jobs:
with:
NODE_ENV: staging
CROWDIN_WALLETS_API_KEY: ${{ secrets.CROWDIN_WALLETS_API_KEY }}
DATADOG_APPLICATION_ID: ${{ vars.DATADOG_APPLICATION_ID }}
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 }}
Expand All @@ -31,16 +31,18 @@ jobs:
GD_APP_ID: ${{ secrets.GD_APP_ID }}
GD_CLIENT_ID: ${{ secrets.GD_CLIENT_ID }}
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
- name: Run tests
run: npm test
- name: Versioning
uses: "./.github/actions/versioning"
with:
release_type: staging
- name: Publish to Cloudflare Pages Staging
- name: Publish to Cloudflare Pages Staging
uses: "./.github/actions/publish_to_pages_staging"
with:
with:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build_test_and_publish:
name: Build, Test and Publish to Cloudflare Test
name: Build, Test and Publish to Cloudflare Test
runs-on: Runner_8cores_Deriv-app
environment: Staging
steps:
Expand All @@ -21,7 +21,7 @@ jobs:
with:
NODE_ENV: staging
CROWDIN_WALLETS_API_KEY: ${{ secrets.CROWDIN_WALLETS_API_KEY }}
DATADOG_APPLICATION_ID: ${{ vars.DATADOG_APPLICATION_ID }}
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 }}
Expand All @@ -31,11 +31,13 @@ jobs:
GD_APP_ID: ${{ secrets.GD_APP_ID }}
GD_CLIENT_ID: ${{ secrets.GD_CLIENT_ID }}
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
- name: Run tests
run: npm test
- name: Publish to Cloudflare Pages Test
- name: Publish to Cloudflare Pages Test
uses: "./.github/actions/publish_to_pages_test"
with:
with:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
10 changes: 6 additions & 4 deletions .github/workflows/release_uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build_test_and_publish:
name: Build, Test and Publish to Cloudflare UAT
name: Build, Test and Publish to Cloudflare UAT
runs-on: Runner_16cores_Deriv-app
environment: Staging
steps:
Expand All @@ -21,7 +21,7 @@ jobs:
uses: "./.github/actions/build"
with:
NODE_ENV: staging
DATADOG_APPLICATION_ID: ${{ vars.DATADOG_APPLICATION_ID }}
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 }}
Expand All @@ -31,14 +31,16 @@ jobs:
GD_APP_ID: ${{ secrets.GD_APP_ID }}
GD_CLIENT_ID: ${{ secrets.GD_CLIENT_ID }}
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
- name: Versioning
uses: "./.github/actions/versioning"
with:
release_type: uat
- name: Run tests
run: npm test
- name: Publish to Cloudflare Pages UAT
- name: Publish to Cloudflare Pages UAT
uses: "./.github/actions/publish_to_pages_uat"
with:
with:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ jobs:
run: npx tsc --project packages/wallets/tsconfig.json -noEmit
- name: Check TypeScript for @deriv/tradershub
run: npx tsc --project packages/tradershub/tsconfig.json -noEmit
- name: Check TypeScript for @deriv/account-v2
run: npx tsc --project packages/account-v2/tsconfig.json -noEmit
- name: Check ESLint for @deriv/wallets
run: npx eslint --fix --ignore-path packages/wallets/.eslintignore --config packages/wallets/.eslintrc.js packages/wallets
- name: Check ESLint for @deriv/tradershub
run: npx eslint --fix --ignore-path packages/tradershub/.eslintignore --config packages/tradershub/.eslintrc.js packages/tradershub
- name: Check ESLint for @deriv/account-v2
run: npx eslint --fix --ignore-path packages/account-v2/.eslintignore --config packages/account-v2/.eslintrc.js packages/account-v2
- name: Check Stylelint for @deriv/wallets
run: npx stylelint packages/wallets/**/*.scss
- name: Check Stylelint for @deriv/account-v2
run: npx stylelint packages/account-v2/**/*.scss
- name: Check tests for @deriv/hooks
run: bash ./scripts/check-tests.sh packages/hooks/src
- name: Check tests for @deriv/utils
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ packages/components/src/components/icon/icons-manifest.js
packages/p2p/lib/
packages/appstore/lib/
packages/appstore/.out
packages/wallets/src/translations/messages.json
.env
nx-cloud.env
test-results/
Expand Down
Loading

0 comments on commit 31b861c

Please sign in to comment.