Skip to content

Commit

Permalink
Merge branch master into maryia/kate/DTRA-1279/redesign_position_page
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-deriv committed Jun 4, 2024
2 parents 3c37e0b + e9bdf4d commit 9217413
Show file tree
Hide file tree
Showing 244 changed files with 2,876 additions and 1,784 deletions.
85 changes: 59 additions & 26 deletions .github/actions/analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,31 @@ inputs:
runs:
using: composite
steps:

- name: Get artifact URL
id: get_artifact_url
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
shell: bash
run: |
ARTIFACT_URL=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/actions/artifacts" | \
jq -r '.artifacts | map(select(.workflow_run.head_branch == "master" and (.name | startswith("reports-")))) | .[0] | .archive_download_url')
# Fetching the artifacts and storing response for debugging
RESPONSE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/actions/artifacts?name=analyse")
# uncomment for debugging purposes
# echo "API Response: $RESPONSE"
# Extracting the artifact URL using jq
ARTIFACT_URL=$(echo $RESPONSE | jq -r '.artifacts[0].archive_download_url')
# Check if the artifact URL is empty
if [[ -z "$ARTIFACT_URL" ]]; then
echo "Error: No artifact URL found for the master branch with prefix 'analyse'."
exit 1
else
echo "Artifact URL: $ARTIFACT_URL"
fi
# Output artifact URL for other steps
echo "artifact_url=$ARTIFACT_URL" >> $GITHUB_OUTPUT
echo "artifact_url=$ARTIFACT_URL"
Expand All @@ -89,7 +104,7 @@ runs:
-o artifact.zip
unzip artifact.zip -d old
cd old
unzip reports.zip
unzip analyse.zip
- name: Analyze all packages
env:
Expand Down Expand Up @@ -125,31 +140,49 @@ runs:
echo "EOF" >> $GITHUB_OUTPUT
echo $DIFF_OUTPUT
# - name: Comment on PR with Diff Output
# if: steps.get_artifact_url.outputs.artifact_url != 'null' && inputs.ISSUE_NUMBER
# uses: actions/github-script@v5
# env:
# DIFF_OUTPUT: ${{ steps.diff.outputs.diff_output }}
# ISSUE_NUMBER: ${{ inputs.ISSUE_NUMBER }}
# with:
# script: |
# const diffOutput = process.env.DIFF_OUTPUT;
# const issueNumber = process.env.ISSUE_NUMBER;
# github.rest.issues.createComment({
# owner: context.repo.owner,
# repo: context.repo.repo,
# issue_number: issueNumber,
# body: `${diffOutput}`
# });
- name: Comment on PR with Diff Output
if: steps.get_artifact_url.outputs.artifact_url != 'null' && inputs.ISSUE_NUMBER
uses: actions/github-script@v5
env:
DIFF_OUTPUT: ${{ steps.diff.outputs.diff_output }}
ISSUE_NUMBER: ${{ inputs.ISSUE_NUMBER }}
with:
script: |
const diffOutput = process.env.DIFF_OUTPUT;
const issueNumber = process.env.ISSUE_NUMBER;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: `${diffOutput}`
});
continue-on-error: true

- name: Zip all report.json files
shell: bash
run: |
zip -r reports.zip packages/*/report.json
zip -r analyse.zip packages/*/report.json
# Step for the master branch
- name: Upload analyse.zip for Master Branch
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: analyse
path: analyse.zip
retention-days: 20

- name: Set sanitized branch name
id: sanitize
shell: bash
run: |
SANITIZED_REF_NAME=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9]/-/g')
echo "SANITIZED_REF_NAME=${SANITIZED_REF_NAME}" >> $GITHUB_ENV
- name: Upload reports.zip
- name: Upload analyse.zip for Feature Branches
if: github.ref != 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: reports-${{ github.sha }}
path: reports.zip
retention-days: 5
name: analyse-${{ env.SANITIZED_REF_NAME }}
path: analyse.zip
retention-days: 5
1 change: 1 addition & 0 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
TRUSTPILOT_API_KEY: ${{ secrets.TRUSTPILOT_API_KEY }}
- name: Run tests
run: npm test
- name: Versioning
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
TRUSTPILOT_API_KEY: ${{ secrets.TRUSTPILOT_API_KEY }}
- name: Run tests
run: npm test
- name: Versioning
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
TRUSTPILOT_API_KEY: ${{ secrets.TRUSTPILOT_API_KEY }}
- name: Run tests
run: npm test
- name: Publish to Cloudflare Pages Test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
TRUSTPILOT_API_KEY: ${{ secrets.TRUSTPILOT_API_KEY }}
- name: Versioning
uses: "./.github/actions/versioning"
with:
Expand Down
48 changes: 43 additions & 5 deletions .github/workflows/smoketests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ jobs:

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
if: ${{ github.event.issue.draft == false && contains(github.event.issue.labels.*.name, 'Wallets') }}
uses: cypress-io/github-action@97d526c9027e1b1eedde4f37196aebe8834005ef
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/api/oAuthLogin.cy.js
spec: cypress/e2e/wip/Wallets/*.cy.js
group: 'Smoke Tests'

env:
Expand All @@ -50,20 +51,57 @@ jobs:
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Set Base Url from client_payload.
CYPRESS_BASE_URL: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}
CYPRESS_BASE_URL: https://staging-app.deriv.com/
# Send PR details to Cypress test run
COMMIT_INFO_MESSAGE: PR "${{ github.event.issue.number }}" Changed By "${{ github.event.issue.user.login }}" in Labels "${{ github.event.issue.lables.name }}" (draft? "${{ github.event.issue.draft }} )"
COMMIT_INFO_MESSAGE: PR "${{ github.event.issue.number }}" Changed By "${{ github.event.issue.user.login }}" in Labels "${{ github.event.issue.labels.*.name }}" (draft? "${{ github.event.issue.draft }} )"
# 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 }}
E2E_STD_CONFIG_SERVER: ${{ env.QA_SERVER || secrets.E2E_STD_CONFIG_SERVER }}
E2E_STD_CONFIG_APPID: ${{ github.event.inputs.appid || secrets.E2E_STD_CONFIG_APPID }}
E2E_DOUGHFLOW_CONFIG_SERVER: ${{ secrets.E2E_DOUGHFLOW_CONFIG_SERVER }}
E2E_DOUGHFLOW_CONFIG_APPID: ${{ secrets.E2E_DOUGHFLOW_CONFIG_APPID }}
E2E_QABOX_URL: ${{ secrets.E2E_QABOX_URL }}
E2E_MAIN_QABOX_URL: ${{ secrets.E2E_MAIN_QABOX_URL }}
E2E_QABOX_LOGIN: ${{ secrets.E2E_QABOX_LOGIN }}
E2E_QABOX_PASSWORD: ${{ secrets.E2E_QABOX_PASSWORD }}
TEST_SUITE: ${{ github.event.inputs.suite }}
E2E_DERIV_LOGIN_PROD: ${{secrets.E2E_DERIV_LOGIN_PROD}}
E2E_DERIV_PASSWORD_PROD: ${{secrets.E2E_DERIV_PASSWORD_PROD }}
E2E_PROD_SERVER: ${{secrets.E2E_PROD_SERVER}}
E2E_PROD_APPID: ${{secrets.E2E_PROD_APPID}}
E2E_LOGIN_ID_P2P_FIXEDRATE: ${{ secrets.E2E_LOGIN_ID_P2P_FIXEDRATE }}
E2E_P2P_FLOATING: ${{secrets.E2E_P2P_FLOATING}}
E2E_LOGIN_ID_P2P_STANDARDACCOUNTWITHADS: ${{secrets.E2E_LOGIN_ID_P2P_STANDARDACCOUNTWITHADS}}
E2E_LOGIN_ID_P2P_STANDARDACCOUNTWITHOUTADS: ${{secrets.E2E_LOGIN_ID_P2P_STANDARDACCOUNTWITHOUTADS}}
E2E_LOGIN_ID_P2P_FLOATINGRATE_SELLAD_1: ${{secrets.E2E_LOGIN_ID_P2P_FLOATINGRATE_SELLAD_1}}
E2E_LOGIN_ID_P2P_FLOATINGRATE_SELLAD_2: ${{secrets.E2E_LOGIN_ID_P2P_FLOATINGRATE_SELLAD_2}}
E2E_LOGIN_ID_P2P_EMPTYSTATE: ${{secrets.E2E_LOGIN_ID_P2P_EMPTYSTATE}}
E2E_LOGIN_ID_P2P_SORT: ${{secrets.E2E_LOGIN_ID_P2P_SORT}}
E2E_CRYPTO: ${{secrets.E2E_CRYPTO}}
E2E_STG_APPID: ${{secrets.E2E_STG_APPID}}
E2E_PSWD_P2P: ${{secrets.E2E_PSWD_P2P}}
E2E_CASHIER_WITHDRAWAL_PROD: ${{secrets.E2E_CASHIER_WITHDRAWAL_PROD}}
E2E_CASHIER_PROD_PASSWORD: ${{secrets.E2E_CASHIER_PROD_PASSWORD}}
E2E_LOGIN_ID_DBOT: ${{secrets.E2E_LOGIN_ID_DBOT}}
E2E_LOGIN_ID_PROD_DBOT: ${{secrets.E2E_LOGIN_ID_PROD_DBOT}}
E2E_QA_ACCOUNT_PASSWORD: ${{secrets.E2E_QA_ACCOUNT_PASSWORD}}
E2E_LOGIN_ID_CASHIER_LEGACY: ${{secrets.E2E_LOGIN_ID_CASHIER_LEGACY}}
E2E_LOGIN_ID_CASHIER_LEGACY_NON_USD: ${{secrets.E2E_LOGIN_ID_CASHIER_LEGACY_NON_USD}}
E2E_MAILISK_NAMESPACE: ${{secrets.E2E_MAILISK_NAMESPACE}}
E2E_MAILISK_API_KEY: ${{secrets.E2E_MAILISK_API_KEY}}
E2E_DIEL_LOGIN: ${{secrets.E2E_DIEL_LOGIN}}
E2E_EU_LOGIN: ${{secrets.E2E_EU_LOGIN}}
E2E_APP_REGISTER_URL: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}
E2E_RUN_FROM_PR: ${{secrets.E2E_RUN_FROM_PR}}

- name: Set comments message
id: set_msg
if: always()
if: always() && ${{ github.event.issue.draft == false && contains(github.event.issue.labels.*.name, 'Wallets') }}
run: |
# Using shell script to conditionally set the message
if [[ "${{ job.status }}" == "success" ]]; then
Expand All @@ -73,7 +111,7 @@ jobs:
fi
- name: Leave comment
if: always()
if: always() && ${{ github.event.issue.draft == false && contains(github.event.issue.labels.*.name, 'Wallets') }}
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31
with:
header: Smoke tests status update
Expand Down
Loading

0 comments on commit 9217413

Please sign in to comment.