mirror of
https://github.com/suitenumerique/docs.git
synced 2026-04-25 17:15:01 +02: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:
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
|
||||
|
||||
Reference in New Issue
Block a user