Skip to content

Commit 4fe9a41

Browse files
authored
simplift the pr_deployment flow (#1745)
- not output in the PR - no more `TEST_RESULTS` variable - use `$*` to pass the parameters to the functions - only run a subset of the `sanity` test-suite, ansible/ansible-wisdom-testing#964 - print the direct URL of the test run
1 parent 2f540be commit 4fe9a41

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

.github/workflows/pr_deployment_test.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,25 @@ permissions:
88
pull-requests: read
99

1010
jobs:
11+
pr_deplolyment_test:
12+
if: ${{ github.event.label.name == 'pr-deployment' }}
13+
timeout-minutes: 10
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Wait for PR deployment completion
18+
run: bash ./.github/workflows/scripts/pr_deployment_test.sh wait_for_pr_deployment ${{ github.event.number }} ${{ secrets.PR_DEPLOY_CLUSTER_HOSTNAME }}
19+
shell: bash
1120
pr_testing:
1221
if: ${{ github.event.label.name == 'pr-deployment' }}
1322
runs-on: ubuntu-latest
1423
permissions:
1524
pull-requests: write
16-
needs: deployment_ready
25+
needs: pr_deplolyment_test
1726
steps:
1827
- uses: actions/checkout@v4
1928
- name: Trigger tests on PR deployment
2029
id: test_pr
2130
run: |
22-
TEST_RESULTS=$(bash ./.github/workflows/scripts/pr_deployment_test.sh invoke_pr_test 81148901 ${{ secrets.TESTING_TRIGGER_PAT }} ${{ github.event.number }})
23-
echo "TEST_RESULTS=${TEST_RESULTS}" >> $GITHUB_OUTPUT
31+
bash ./.github/workflows/scripts/pr_deployment_test.sh invoke_pr_test 81148901 ${{ secrets.TESTING_TRIGGER_PAT }} ${{ github.event.number }}
2432
shell: bash
25-
- name: report test results
26-
uses: mshick/add-pr-comment@v2
27-
with:
28-
message: |
29-
${{ steps.test_pr.outputs.TEST_RESULTS }}
30-
31-
32-
deployment_ready:
33-
if: ${{ github.event.label.name == 'pr-deployment' }}
34-
timeout-minutes: 10
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@v4
38-
- name: Wait for PR deployment completion
39-
run: bash ./.github/workflows/scripts/pr_deployment_test.sh wait_for_pr_deployment ${{ github.event.number }} ${{ secrets.PR_DEPLOY_CLUSTER_HOSTNAME }}
40-
shell: bash

.github/workflows/scripts/pr_deployment_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ invoke_pr_test() {
3434
run_status=$(echo "$run_info" | jq -r '.status')
3535
if [[ $run_status == "completed" ]]; then
3636
conclusion=$(echo "$run_info" | jq -r '.conclusion')
37-
echo "Tests execution https://api.github.com/repos/ansible/ansible-wisdom-testing/actions/runs/$RUN_ID completed with conclusion: $conclusion"
37+
echo "Tests execution https://github.com/ansible/ansible-wisdom-testing/actions/runs/$RUN_ID completed with conclusion: $conclusion"
3838
if [[ $conclusion == "success" ]]; then
3939
exit 0
4040
else
@@ -74,4 +74,4 @@ wait_for_pr_deployment() {
7474
echo "Deployment probably is broken. Please check"
7575
}
7676

77-
$1 $2 $3 $4 $5 $6 $7
77+
$*

0 commit comments

Comments
 (0)