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
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-07-04 17:59:46 -03:00 committed by GitHub
commit 71e3ed92d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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