@@ -3,11 +3,9 @@ name: Deep Purple E2E Test Runner (Frontend Apps Only)
33on :
44 workflow_call :
55 secrets :
6- CLOUDFLARE_BYPASS_TOKEN :
6+ JENKINS_OKTA_USERNAME :
77 required : true
8- STAGING_BASIC_PASSWORD :
9- required : true
10- STAGING_PERSONAL_ACCESS_TOKEN :
8+ JENKINS_USER_TOKEN :
119 required : true
1210 inputs :
1311 app :
2523 name : Run Deep Purple Tests Against Changes
2624 runs-on : [self-hosted, "${{ inputs.runner }}"]
2725
28- env :
29- DOCKER_IMAGE : 567716553783.dkr.ecr.us-east-1.amazonaws.com/deep-purple:latest
30-
3126 steps :
3227 - name : Check out Git repository
3328 uses : actions/checkout@v5
@@ -44,31 +39,39 @@ jobs:
4439 - name : Print extracted app name
4540 run : echo "Extracted APP_NAME is ${{ env.APP_NAME }}"
4641
47- - name : Create test-results directory
48- run : mkdir -p ${{ github.workspace }}/test-results
49-
5042 - name : Run Deep Purple tests
51- run : |
52- docker run --name deep-purple-container \
53- -v ${{ github.workspace }}/test-results:/home/pwuser/test-results \
54- -e CLOUDFLARE_BYPASS_TOKEN=${{ secrets.CLOUDFLARE_BYPASS_TOKEN }} \
55- -e STAGING_BASIC_PASSWORD=${{ secrets.STAGING_BASIC_PASSWORD }} \
56- -e STAGING_PERSONAL_ACCESS_TOKEN=${{ secrets.STAGING_PERSONAL_ACCESS_TOKEN }} \
57- -e PREVIEW_APP_NAME="${{ env.APP_NAME }}" \
58- -e PREVIEW_APP_VERSION="${{ github.sha }}" \
59- -e MANUAL_BUILD=true \
60- -e DOMAIN=staging.tfdev.typeform.com \
61- ${{ env.DOCKER_IMAGE }} \
62- yarn test:ci:all
43+ id : ' deep-purple-tests'
44+ uses : Typeform/deep-purple-action@v1
45+ env :
46+ JENKINS_OKTA_USERNAME : ${{ secrets.JENKINS_OKTA_USERNAME }}
47+ JENKINS_USER_TOKEN : ${{ secrets.JENKINS_USER_TOKEN }}
48+ with :
49+ preview-app-name : ${{ env.APP_NAME }}
50+ preview-app-version : ${{ github.sha }}
51+ gha-repo : ${{ github.repository }}
52+ gha-event-name : ${{ github.event_name }}
53+ gha-ref-name : ${{ github.ref_name }}
54+ gha-actor : ${{ github.triggering_actor }}
55+ gha-workflow-run-url : " ${{github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
6356
64- - name : Post test report to PR comments
65- uses : ctrf-io/github-test-reporter@v1
57+ - name : Find previous Deep Purple run comment
58+ if : ${{ !contains(github.ref, 'refs/heads/master') && !contains(github.ref, 'refs/heads/main') && (success() || failure()) }}
59+ uses : peter-evans/find-comment@v3
60+ id : previous-deep-purple-comment
6661 with :
67- report-path : " ${{ github.workspace }}/test-results/ctrf/*.json"
68- pull-request-report : true
69- overwrite-comment : true
70- exit-on-fail : true
71- title : " Deep Purple Results"
72- env :
73- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74- if : always()
62+ token : ${{ secrets.GITHUB_TOKEN }}
63+ issue-number : ${{ github.event.number }}
64+ body-includes : ' ## Deep Purple'
65+
66+ - name : Publish Deep Purple comment
67+ if : ${{ !contains(github.ref, 'refs/heads/master') && !contains(github.ref, 'refs/heads/main') && (success() || failure()) }}
68+ uses : peter-evans/create-or-update-comment@v4
69+ with :
70+ token : ${{ secrets.GITHUB_TOKEN }}
71+ comment-id : ${{ steps.previous-deep-purple-comment.outputs.comment-id }}
72+ issue-number : ${{ github.event.number }}
73+ edit-mode : replace
74+ body : |
75+ ## Deep Purple
76+
77+ ${{ steps.deep-purple-tests.outputs.help-message }}
0 commit comments