From 71e3ed92d803864dda6aef47875a2c4f26991ff9 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 4 Jul 2024 17:59:46 -0300 Subject: [PATCH] ci: add outputs and conditional step to TypeScript test workflow (#2541) * feat: Add outputs to TypeScript test workflow The recent code changes added outputs to the TypeScript test workflow in order to capture the status of the tests. This will allow for better visibility and tracking of test failures. * chore: Add conditional step to merge-reports job in TypeScript test workflow --- .github/workflows/typescript_test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/typescript_test.yml b/.github/workflows/typescript_test.yml index b7beb96d7..3f1d9cd58 100644 --- a/.github/workflows/typescript_test.yml +++ b/.github/workflows/typescript_test.yml @@ -34,6 +34,8 @@ jobs: env: OPENAI_API_KEY: ${{ inputs.openai_api_key || secrets.OPENAI_API_KEY }} STORE_API_KEY: ${{ inputs.store_api_key || secrets.STORE_API_KEY }} + outputs: + failed: ${{ steps.check-failure.outputs.failed }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -107,6 +109,15 @@ jobs: run: | cd src/frontend npx playwright test --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2 + continue-on-error: true + + # If the test fails, set a flag to indicate that the shard failed + - name: Set failure flag + id: check-failure + if: failure() + run: echo "failed=true" >> "$GITHUB_OUTPUT" + + - name: Upload blob report to GitHub Actions Artifacts if: always() @@ -116,9 +127,12 @@ jobs: path: src/frontend/blob-report retention-days: 1 + + merge-reports: needs: setup-and-test runs-on: ubuntu-latest + if : ${{ needs.setup-and-test.outputs.failed != 'true' }} steps: - name: Checkout code uses: actions/checkout@v4