File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : E2E tests
22description : " Run end-to-end tests for this repo"
33
4- inputs :
5- pr_number :
6- required : true
7- type : string
8-
94runs :
105 using : " composite"
116
127 steps :
13- - name : Check if e2e tests should run
14- id : check_e2e
15- shell : bash
16- env :
17- GITHUB_TOKEN : ${{ env.GITHUB_TOKEN }}
18- run : |
19- if [[ -n "${{ inputs.pr_number }}" ]]; then
20- labels=$(gh pr view "${{ inputs.pr_number }}" --json labels --jq '.labels[].name' 2>/dev/null || echo "")
21-
22- if echo "$labels" | grep -Fxq 'deploy-proxy'; then
23- echo "deploy-proxy label found; e2e tests will run."
24- echo "run_e2e=true" >> $GITHUB_OUTPUT
25- else
26- echo "deploy-proxy label not found; e2e tests will be skipped."
27- echo "run_e2e=false" >> $GITHUB_OUTPUT
28- fi
29- else
30- echo "Not a PR environment; e2e tests will run."
31- echo "run_e2e=true" >> $GITHUB_OUTPUT
32- fi
33-
348 - name : Install poetry and e2e test dependencies
35- if : steps.check_e2e.outputs.run_e2e == 'true'
369 shell : bash
3710 run : |
3811 pipx install poetry
3912 cd tests/e2e-tests && poetry install
4013
4114 - name : Run e2e tests
42- if : steps.check_e2e.outputs.run_e2e == 'true'
4315 shell : bash
4416 run : |
4517 echo "$INTERNAL_DEV_TEST_PEM" > "${GITHUB_WORKSPACE}/internal-dev-test-1.pem"
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ jobs:
178178 terraform_version : " ${{ needs.metadata.outputs.terraform_version }}"
179179 version : " ${{ needs.metadata.outputs.version }}"
180180 pr_number : ${{ needs.metadata.outputs.pr_number }}
181+ proxy_deployed : " ${{ needs.metadata.outputs.deploy_proxy }}"
181182 secrets : inherit
182183 publish-stage : # Recommended maximum execution time is 10 minutes
183184 name : " Publish stage"
Original file line number Diff line number Diff line change 3434 pr_number :
3535 required : true
3636 type : string
37+ proxy_deployed :
38+ description : " True if the APIM proxy was deployed"
39+ required : true
40+ type : string
3741
3842permissions :
3943 id-token : write
8185 run-e2e-tests :
8286 name : Run End-to-End Tests
8387 runs-on : ubuntu-latest
88+ if : inputs.proxy_deployed == 'true'
8489 steps :
8590 - uses : actions/checkout@v5.0.0
8691
9095 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9196 NON_PROD_API_KEY : ${{ secrets.NON_PROD_API_KEY }}
9297 INTERNAL_DEV_TEST_PEM : ${{ secrets.INTERNAL_DEV_TEST_PEM }}
93- with :
94- pr_number : ${{ inputs.pr_number }}
You can’t perform that action at this time.
0 commit comments