Skip to content

Commit e38dba8

Browse files
committed
fix(tests): Fix last commit check
1 parent 9d13bcc commit e38dba8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,19 @@ jobs:
6363
run: |
6464
if [ ${{ github.event_name }} != 'pull_request' ]; then
6565
# if [ ${{ github.event_name }} == 'schedule' ]; then
66-
last_run_commit=$(jq -r '.commit_sha' ./runtime-test-results/test_results.json)
66+
if [ -f ./runtime-test-results/test_results.json ]; then
67+
last_run_commit=$(jq -r '.commit_sha' ./runtime-test-results/test_results.json)
68+
last_run_failed=$(jq -r '.tests_failed' ./runtime-test-results/test_results.json)
69+
else
70+
last_run_commit="none"
71+
last_run_failed="true"
72+
fi
6773
current_commit=${{ github.sha }}
68-
if [ "$last_run_commit" == "$current_commit" ]; then
74+
if [ "$last_run_commit" == "$current_commit" ] && [ "$last_run_failed" == "false" ]; then
6975
echo "Last run commit and current commit are the same. Skipping tests..."
7076
echo "run_tests=false" >> $GITHUB_OUTPUT
7177
else
72-
echo "Last run commit and current commit are different. Running tests..."
78+
echo "Last run commit and current commit are different or last run failed. Running tests..."
7379
echo "run_tests=true" >> $GITHUB_OUTPUT
7480
fi
7581
else

0 commit comments

Comments
 (0)