From bf37729c7e492dabea88348da7afe64c83bd00c8 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 18 Oct 2024 19:08:44 +0000 Subject: [PATCH] [CI/Build] Make mypy job fail when errors occur Fix `tools/mypy.sh` to fail when any command fails when running in CI. Signed-off-by: Russell Bryant --- .github/workflows/mypy.yaml | 2 +- tools/mypy.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 2bcfdc8004ae8..5f1e5f8eeaf7d 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -33,4 +33,4 @@ jobs: - name: Mypy run: | echo "::add-matcher::.github/workflows/matchers/mypy.json" - tools/mypy.sh + tools/mypy.sh 1 diff --git a/tools/mypy.sh b/tools/mypy.sh index d69b61c7f34fc..14b0976a27da5 100755 --- a/tools/mypy.sh +++ b/tools/mypy.sh @@ -2,6 +2,10 @@ CI=${1:-0} +if [ $CI -eq 1 ]; then + set -e +fi + run_mypy() { echo "Running mypy on $1" if [ $CI -eq 1 ] && [ -z "$1" ]; then