From 539007c1732d30e58aeb869aa3b7aee64fabfa5e Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Mon, 1 Aug 2022 12:54:39 +0100 Subject: [PATCH] github/workflows: make bash more strict (#2197) --- .github/actions/run-python-test-set/action.yml | 8 ++++---- .github/actions/save-coverage-data/action.yml | 2 +- .github/workflows/benchmarking.yml | 2 +- .github/workflows/build_and_test.yml | 2 +- .github/workflows/codestyle.yml | 2 +- .github/workflows/pg_clients.yml | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/run-python-test-set/action.yml b/.github/actions/run-python-test-set/action.yml index a956929d92..6dc377a809 100644 --- a/.github/actions/run-python-test-set/action.yml +++ b/.github/actions/run-python-test-set/action.yml @@ -38,7 +38,7 @@ runs: path: ./neon-artifact/ - name: Extract Neon artifact - shell: bash -ex {0} + shell: bash -euxo pipefail {0} run: | mkdir -p /tmp/neon/ tar -xf ./neon-artifact/neon.tar.zst -C /tmp/neon/ @@ -59,7 +59,7 @@ runs: key: v1-${{ runner.os }}-python-deps-${{ hashFiles('poetry.lock') }} - name: Install Python deps - shell: bash -ex {0} + shell: bash -euxo pipefail {0} run: ./scripts/pysync - name: Run pytest @@ -70,7 +70,7 @@ runs: # this variable will be embedded in perf test report # and is needed to distinguish different environments PLATFORM: github-actions-selfhosted - shell: bash -ex {0} + shell: bash -euxo pipefail {0} run: | PERF_REPORT_DIR="$(realpath test_runner/perf-report-local)" rm -rf $PERF_REPORT_DIR @@ -123,7 +123,7 @@ runs: fi - name: Delete all data but logs - shell: bash -ex {0} + shell: bash -euxo pipefail {0} if: always() run: | du -sh /tmp/test_output/* diff --git a/.github/actions/save-coverage-data/action.yml b/.github/actions/save-coverage-data/action.yml index 7ad04cf1fe..bcfd7cb47e 100644 --- a/.github/actions/save-coverage-data/action.yml +++ b/.github/actions/save-coverage-data/action.yml @@ -5,7 +5,7 @@ runs: using: "composite" steps: - name: Merge coverage data - shell: bash -ex {0} + shell: bash -euxo pipefail {0} run: scripts/coverage "--profraw-prefix=$GITHUB_JOB" --dir=/tmp/coverage merge - name: Upload coverage data diff --git a/.github/workflows/benchmarking.yml b/.github/workflows/benchmarking.yml index cfd54325eb..427441f330 100644 --- a/.github/workflows/benchmarking.yml +++ b/.github/workflows/benchmarking.yml @@ -60,7 +60,7 @@ jobs: - name: Setup cluster env: BENCHMARK_CONNSTR: "${{ secrets.BENCHMARK_STAGING_CONNSTR }}" - shell: bash + shell: bash -euxo pipefail {0} run: | set -e diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ba36c62156..312b4d1f46 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -9,7 +9,7 @@ on: defaults: run: - shell: bash -ex {0} + shell: bash -euxo pipefail {0} concurrency: # Allow only one workflow per any non-`main` branch. diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 8bcaa8f947..3acbeae9c2 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -8,7 +8,7 @@ on: defaults: run: - shell: bash -ex {0} + shell: bash -euxo pipefail {0} concurrency: # Allow only one workflow per any non-`main` branch. diff --git a/.github/workflows/pg_clients.yml b/.github/workflows/pg_clients.yml index 4ff31ac508..ba2d5cf666 100644 --- a/.github/workflows/pg_clients.yml +++ b/.github/workflows/pg_clients.yml @@ -40,7 +40,7 @@ jobs: key: v1-${{ runner.os }}-python-deps-${{ hashFiles('poetry.lock') }} - name: Install Python deps - shell: bash -ex {0} + shell: bash -euxo pipefail {0} run: ./scripts/pysync - name: Run pytest @@ -49,7 +49,7 @@ jobs: BENCHMARK_CONNSTR: "${{ secrets.BENCHMARK_STAGING_CONNSTR }}" TEST_OUTPUT: /tmp/test_output POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install - shell: bash -ex {0} + shell: bash -euxo pipefail {0} run: | # Test framework expects we have psql binary; # but since we don't really need it in this test, let's mock it