From baeb0ba4d66735df0dcf2c7fbdc777e817b49733 Mon Sep 17 00:00:00 2001 From: catatsuy Date: Sat, 24 Aug 2024 14:56:54 +0900 Subject: [PATCH] Add check for benchmark_output.json existence before processing it --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ceb271e0..2ba4c03b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,15 @@ jobs: - name: Check benchmark result run: | - cat benchmark_output.json | jq '.pass' | grep false && echo "BENCHMARK_FAILED=true" >> $GITHUB_ENV || true + cd benchmarker + if [ ! -f benchmark_output.json ]; then + echo "benchmark_output.json not found" + exit 1 + fi + if ! jq -e '.pass == true' benchmark_output.json > /dev/null; then + echo "BENCHMARK_FAILED=true" >> $GITHUB_ENV + exit 1 + fi - name: Show logs run: |