mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
🐛(CI) add last-failed flag only if last-run is filled
We got cases where the last-run is empty, but the last-failed flag is set to true. If that happens, the workflow will fail because the last-run is empty. We now check if the last-run is filled before setting the last-failed flag.
This commit is contained in:
parent
0060c59615
commit
d68d7ee31d
1 changed files with 14 additions and 2 deletions
16
.github/workflows/impress-frontend.yml
vendored
16
.github/workflows/impress-frontend.yml
vendored
|
|
@ -164,7 +164,13 @@ jobs:
|
|||
|
||||
LAST_FAILED_FLAG=""
|
||||
if [ "${{ github.run_attempt }}" != "1" ]; then
|
||||
LAST_FAILED_FLAG="--last-failed"
|
||||
LAST_RUN_FILE="apps/e2e/test-results/.last-run.json"
|
||||
if [ -f "$LAST_RUN_FILE" ]; then
|
||||
FAILED_COUNT=$(jq '.failedTests | length' "$LAST_RUN_FILE" 2>/dev/null || echo "0")
|
||||
if [ "${FAILED_COUNT:-0}" -gt "0" ]; then
|
||||
LAST_FAILED_FLAG="--last-failed"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
yarn e2e:test --project='chromium' $LAST_FAILED_FLAG
|
||||
|
|
@ -246,7 +252,13 @@ jobs:
|
|||
|
||||
LAST_FAILED_FLAG=""
|
||||
if [ "${{ github.run_attempt }}" != "1" ]; then
|
||||
LAST_FAILED_FLAG="--last-failed"
|
||||
LAST_RUN_FILE="apps/e2e/test-results/.last-run.json"
|
||||
if [ -f "$LAST_RUN_FILE" ]; then
|
||||
FAILED_COUNT=$(jq '.failedTests | length' "$LAST_RUN_FILE" 2>/dev/null || echo "0")
|
||||
if [ "${FAILED_COUNT:-0}" -gt "0" ]; then
|
||||
LAST_FAILED_FLAG="--last-failed"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
yarn e2e:test --project=firefox --project=webkit $LAST_FAILED_FLAG
|
||||
|
|
|
|||
Loading…
Reference in a new issue