Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into translators
Browse files Browse the repository at this point in the history
  • Loading branch information
mitra-deriv committed Nov 2, 2023
2 parents f996d07 + ea934a6 commit 72af3af
Show file tree
Hide file tree
Showing 409 changed files with 13,403 additions and 18,477 deletions.
48 changes: 40 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
],
"overrides": [
{
"files": ["*.ts", "*.tsx"], // Your TypeScript files extension
"files": [
"*.ts",
"*.tsx"
], // Your TypeScript files extension
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
Expand All @@ -18,7 +21,11 @@
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": ["deprecation", "@typescript-eslint", "jest"],
"plugins": [
"deprecation",
"@typescript-eslint",
"jest"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"deprecation/deprecation": "warn"
Expand All @@ -30,7 +37,10 @@
}
}
],
"plugins": ["@typescript-eslint", "jest"],
"plugins": [
"@typescript-eslint",
"jest"
],
"rules": {
"strict": 0,
"camelcase": 0,
Expand Down Expand Up @@ -68,15 +78,30 @@
"import/no-extraneous-dependencies": [
0,
{
"extensions": [".jsx"]
"extensions": [
".jsx"
]
}
],
"import/no-useless-path-segments": "error",
"import/prefer-default-export": 0,
"import/order": [
"error",
{
"groups": ["builtin", "external", "parent", "sibling", "index"],
"groups": [
"builtin",
"external",
"parent",
"sibling",
"index"
],
"pathGroups": [
{
"pattern": "features/components/templates/layout",
"group": "parent",
"position": "after"
}
],
"newlines-between": "never"
}
],
Expand Down Expand Up @@ -104,12 +129,19 @@
"settings": {
"import/resolver": {
"node": {
"paths": ["src"],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
"paths": [
"src"
],
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
},
"react": {
"version": "17"
}
}
}
}
10 changes: 6 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
# mohsen-deriv
# mitra-deriv
# fasihali-deriv
# aswathy-deriv
# meenakshi-deriv

######################################################################################################
#
Expand Down Expand Up @@ -74,9 +76,9 @@
# deriv-com/shared-components
# ==============================================================

/src/common/**/* @habib-deriv @yashim-deriv @prince-deriv
/src/components/**/* @habib-deriv @yashim-deriv @prince-deriv
/src/themes/**/* @habib-deriv @yashim-deriv @prince-deriv
/src/common/**/* @habib-deriv @yashim-deriv @prince-deriv @aswathy-deriv @mitra-deriv
/src/components/**/* @habib-deriv @yashim-deriv @prince-deriv @meenakshi-deriv
/src/themes/**/* @habib-deriv @yashim-deriv @prince-deriv @fasihali-deriv
/src/features/**/* @habib-deriv @prince-deriv @mitra-deriv @fasihali-deriv


Expand Down Expand Up @@ -108,4 +110,4 @@
# ==============================================================

/storybooks.d.ts
@prince-deriv @habib-deriv
@prince-deriv @habib-deriv @mitra-deriv @fasihali-deriv @aswathy-deriv @meenakshi-deriv
2 changes: 1 addition & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ env:
GATSBY_DATADOG_CLIENT_TOKEN: ${{ secrets.GATSBY_DATADOG_CLIENT_TOKEN }}
GATSBY_MAP_API_KEY: ${{ secrets.GATSBY_MAP_API_KEY }}
GATSBY_GROWTHBOOK_CLIENT_KEY: ${{ secrets.GATSBY_GROWTHBOOK_CLIENT_KEY }}
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_RUDDERSTACK_URL: ${{ secrets.GATSBY_RUDDERSTACK_URL }}

jobs:
release-beta:
Expand Down
43 changes: 9 additions & 34 deletions .github/workflows/generate-preview-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ jobs:

- name: Build project
id: build-project
env:
GATSBY_ENV: staging
GATSBY_GROWTHBOOK_CLIENT_KEY: ${{ secrets.GATSBY_GROWTHBOOK_CLIENT_KEY }}
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}
run: npm run build

- name: Publish to Cloudflare Pages
Expand All @@ -127,13 +134,12 @@ jobs:
directory='public'
projectName='deriv-com-preview-links'
head_branch=${{github.event.workflow_run.head_branch}}
branch=$(echo $head_branch | head -c 20)
branch=$(echo $head_branch | head -c 20 | sed 's/[\/_\.]/-/g; s/[^a-zA-Z0-9]$/1/')
preview_url=$(wrangler pages deploy $directory --project-name=$projectName --branch=$branch > log.txt 2>&1; echo $?)
echo "------"
cat log.txt
branchName=$(echo $branch | sed 's/[\/_\.]/-/g; s/[^a-zA-Z]$//')
if grep -q "Deployment complete" log.txt; then
echo "preview_url=https://$branchName.deriv-com-preview-links.pages.dev" > "$GITHUB_OUTPUT"
echo "preview_url=https://$branch.deriv-com-preview-links.pages.dev" > "$GITHUB_OUTPUT"
else
echo "Deployment to Cloudflare Pages failed."
exit 1
Expand Down Expand Up @@ -181,34 +187,3 @@ jobs:
number: ${{steps.pr_information.outputs.issue_number}}
message: ${{steps.generate_preview_url.outputs.comment || steps.generate_failure_comment.outputs.comment }}
recreate: true

- name: e2e Smoke Tests
uses: actions/checkout@v4
with:
repository: deriv-com/e2e-deriv-com # Replace with your repository name

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v6
with:
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
# start: npm start
# wait-on: 'http://localhost:3000' # Waits for above
# 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.publish-to-pages.outputs.preview_url}}
# Send PR and Repo details to Cypress Cloud test run
COMMIT_INFO_MESSAGE: PR "${{steps.pr_information.outputs.issue_number}}" in Repo "${{ github.repository }}"
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ env:
GATSBY_DATADOG_CLIENT_TOKEN: ${{ secrets.GATSBY_DATADOG_CLIENT_TOKEN }}
GATSBY_MAP_API_KEY: ${{ secrets.GATSBY_MAP_API_KEY }}
GATSBY_GROWTHBOOK_CLIENT_KEY: ${{ secrets.GATSBY_GROWTHBOOK_CLIENT_KEY }}
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_RUDDERSTACK_URL: ${{ secrets.GATSBY_RUDDERSTACK_URL }}

jobs:
release-production:
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/smoketests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Run Smoke Tests

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,3,4,5]

steps:
- name: Capture Vercel preview URL
id: vercel_preview_url
uses: binary-com/[email protected]
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'

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: 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
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ env:
GATSBY_DATADOG_CLIENT_TOKEN: ${{ secrets.GATSBY_DATADOG_CLIENT_TOKEN }}
GATSBY_MAP_API_KEY: ${{ secrets.GATSBY_MAP_API_KEY }}
GATSBY_GROWTHBOOK_CLIENT_KEY: ${{ secrets.GATSBY_GROWTHBOOK_CLIENT_KEY }}
GATSBY_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GATSBY_GROWTHBOOK_DECRYPTION_KEY }}
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_RUDDERSTACK_URL: ${{ secrets.GATSBY_RUDDERSTACK_URL }}
GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}

jobs:
Expand Down
Loading

0 comments on commit 72af3af

Please sign in to comment.