Skip to content

Commit

Permalink
Merge pull request #367 from deriv-com/mark/run-e2e-tests-on-commit-v6
Browse files Browse the repository at this point in the history
Created a manual action for smoke tests
  • Loading branch information
farrah-deriv authored Sep 27, 2024
2 parents 609fc65 + 988ef56 commit 0f39b99
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/smoketests-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run Smoke Tests - Manual

on:
workflow_dispatch:

jobs:
trigger-workflow:
runs-on: ubuntu-latest
steps:
- name: Download artifact
id: download-artifact
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
name: 'pr-${{ github.event.workflow_run.id }}'
path: pr
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Retrieve pull request
id: pr_information
run: |
echo "issue_number=$(cat ./pr/NR)" >> $GITHUB_OUTPUT
echo "preview_url=$(cat ./pr/PREVIEW_URL)" >> $GITHUB_OUTPUT
echo "user_name=$(cat ./pr/USERNAME)" >> $GITHUB_OUTPUT
echo "draft=$(cat ./pr/DRAFT)" >> $GITHUB_OUTPUT
- name: Trigger deriv-app smoke tests from regentmarkets
uses: actions/github-script@v6
with:
github-token: ${{ secrets.E2E_WORKFLOW_TOKEN }}
script: |
const workflowInputs = {
environment: '${{ secrets.E2E_WORKFLOW_ENV }}',
suite: 'P2P-V2',
appRegUrl: '${{ steps.pr_information.outputs.preview_url }}',
issue_number: '${{ steps.pr_information.outputs.issue_number }}',
user_name: '${{ steps.pr_information.outputs.user_name }}'
};
const response = await github.rest.actions.createWorkflowDispatch({
owner: 'regentmarkets',
repo: 'e2e-deriv-app',
workflow_id: 'E2E_Run_PR.yml',
ref: 'master',
inputs: workflowInputs
});
3 changes: 1 addition & 2 deletions .github/workflows/smoketests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Smoke Tests - Deriv app
name: Run Smoke Tests

on:
workflow_run:
Expand Down Expand Up @@ -37,7 +37,6 @@ jobs:
environment: '${{ secrets.E2E_WORKFLOW_ENV }}',
suite: 'P2P-V2',
appRegUrl: '${{ steps.pr_information.outputs.preview_url }}',
appid: ${{ secrets.E2E_APPID }},
issue_number: '${{ steps.pr_information.outputs.issue_number }}',
user_name: '${{ steps.pr_information.outputs.user_name }}'
};
Expand Down

0 comments on commit 0f39b99

Please sign in to comment.