From 6b953705c12dbc437d29831b928364ebdf61498e Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Tue, 16 Jan 2024 11:44:09 -0800 Subject: [PATCH] Reporting functional test only on all pass Signed-off-by: willdavsmith --- .github/workflows/functional-test.yaml | 28 +++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index 8c39239d2bb..f0bac96611e 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -325,6 +325,8 @@ jobs: DE_IMAGE: ${{ needs.build.outputs.DE_IMAGE }} DE_TAG: ${{ needs.build.outputs.DE_TAG }} FUNCTIONAL_TEST_APP_ID: 425843 + outputs: + test_status: ${{ steps.report_test_status.outputs.test_status }} steps: - name: Login as the GitHub App uses: tibdex/github-app-token@v1 @@ -606,6 +608,30 @@ jobs: append: true message: | :x: ${{ matrix.name }} functional test cancelled. Please check [the logs](${{ env.ACTION_LINK }}) for more details + - id: report_test_status + if: always() + run: | + if ${{ env.test_status }} == 'failure' || ${{ job.status }} == 'failure' || ${{ job.status }} == 'cancelled'; then + echo "test_status=failure" >> $GITHUB_OUTPUT + echo "test_status=failure" >> $GITHUB_ENV + else + echo "test_status=success" >> $GITHUB_OUTPUT + fi + report-test-results: + name: Report test results + needs: [build, tests] + runs-on: ubuntu-latest + if: always() + env: + CHECKOUT_REF: ${{ needs.build.outputs.CHECKOUT_REF }} + FUNCTIONAL_TEST_APP_ID: 425843 + steps: + - name: Login as the GitHub App + uses: tibdex/github-app-token@v1 + id: get_installation_token + with: + app_id: ${{ env.FUNCTIONAL_TEST_APP_ID }} + private_key: ${{ secrets.FUNCTIONAL_TEST_APP_PRIVATE_KEY }} - uses: LouisBrunner/checks-action@v1.6.1 if: always() with: @@ -614,7 +640,7 @@ jobs: repo: ${{ github.repository }} sha: ${{ env.CHECKOUT_REF }} status: completed - conclusion: ${{ job.status }} + conclusion: ${{ needs.tests.outputs.test_status }} output: | {"summary":"Functional Test run completed. See links for more information.","title":"Functional Test Run"} details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}