Skip to content

Commit

Permalink
ci: make sure bash has pipefail (#2423)
Browse files Browse the repository at this point in the history
Continuation of #2421.
  • Loading branch information
lidavidm authored Jan 7, 2025
1 parent 1b37f4e commit 196522b
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 112 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ concurrency:
permissions:
contents: read

defaults:
run:
# 'bash' will expand to -eo pipefail
shell: bash

jobs:
csharp:
name: "C# ${{ matrix.os }} ${{ matrix.dotnet }}"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ concurrency:
permissions:
contents: read

defaults:
run:
# 'bash' will expand to -eo pipefail
shell: bash

jobs:
pre-commit:
name: "pre-commit"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dev_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ permissions:
issues: write
pull-requests: write

defaults:
run:
# 'bash' will expand to -eo pipefail
shell: bash

jobs:
process:
name: Process
Expand Down
32 changes: 4 additions & 28 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ env:
# Increment this to reset cache manually
CACHE_NUMBER: "0"

defaults:
run:
shell: bash -l -eo pipefail {0}

jobs:
duckdb:
name: "DuckDB Integration Tests"
Expand All @@ -57,7 +61,6 @@ jobs:
persist-credentials: false
- name: Get Date
id: get-date
shell: bash
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
- name: Cache Conda
Expand All @@ -71,16 +74,13 @@ jobs:
use-only-tar-bz2: false
use-mamba: true
- name: Install Dependencies
shell: bash -l {0}
run: |
mamba install -c conda-forge \
--file ci/conda_env_cpp.txt
- name: Work around ASAN issue (GH-1617)
shell: bash -l {0}
run: |
sudo sysctl vm.mmap_rnd_bits=28
- name: Build DuckDB Integration Tests
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_MANAGER: "1"
Expand All @@ -92,7 +92,6 @@ jobs:
run: |
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- name: Run DuckDB Integration Tests
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_INTEGRATION_DUCKDB: "1"
Expand All @@ -112,7 +111,6 @@ jobs:
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
- name: Cache Conda
Expand All @@ -126,7 +124,6 @@ jobs:
use-only-tar-bz2: false
use-mamba: true
- name: Install Dependencies
shell: bash -l {0}
run: |
mamba install -c conda-forge \
--file ci/conda_env_cpp.txt \
Expand All @@ -139,18 +136,15 @@ jobs:
cache: true
cache-dependency-path: go/adbc/go.sum
- name: Work around ASAN issue (GH-1617)
shell: bash -l {0}
run: |
sudo sysctl vm.mmap_rnd_bits=28
- name: Start SQLite server and Dremio
shell: bash -l {0}
run: |
docker compose up --detach flightsql-test flightsql-sqlite-test dremio dremio-init
pip install python-dotenv[cli]
python -m dotenv -f .env list --format simple | tee -a $GITHUB_ENV
- name: Build FlightSQL Driver
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_FLIGHTSQL: "1"
Expand All @@ -159,23 +153,20 @@ jobs:
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build"
- name: Test FlightSQL Driver against Dremio and SQLite
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_FLIGHTSQL: "1"
run: |
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
./ci/scripts/cpp_test.sh "$(pwd)/build"
- name: Test Python Flight SQL driver against Dremio
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_FLIGHTSQL: "1"
PYTEST_ADDOPTS: "--error-for-skips"
run: |
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
- name: Stop SQLite server and Dremio
shell: bash -l {0}
run: |
docker compose down
Expand All @@ -189,7 +180,6 @@ jobs:
persist-credentials: false
- name: Get Date
id: get-date
shell: bash
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
- name: Cache Conda
Expand All @@ -203,18 +193,15 @@ jobs:
use-only-tar-bz2: false
use-mamba: true
- name: Install Dependencies
shell: bash -l {0}
run: |
mamba install -c conda-forge \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt
pip install pytest-error-for-skips
- name: Work around ASAN issue (GH-1617)
shell: bash -l {0}
run: |
sudo sysctl vm.mmap_rnd_bits=28
- name: Build PostgreSQL Driver
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_MANAGER: "1"
Expand All @@ -223,15 +210,13 @@ jobs:
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build"
- name: Configure Integration Env Vars
shell: bash -l {0}
run: |
pip install python-dotenv[cli]
python -m dotenv -f .env list --format simple | tee -a $GITHUB_ENV
echo "ADBC_USE_ASAN=ON" >> $GITHUB_ENV
echo "ADBC_USE_UBSAN=ON" >> $GITHUB_ENV
- name: Test PostgreSQL Driver - postgres 13
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
Expand All @@ -242,7 +227,6 @@ jobs:
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
- name: Test PostgreSQL Driver - postgres 14
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
Expand All @@ -253,7 +237,6 @@ jobs:
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
- name: Test PostgreSQL Driver - postgres 15
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
Expand All @@ -264,7 +247,6 @@ jobs:
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
- name: Test PostgreSQL Driver - postgres 16
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
Expand All @@ -275,7 +257,6 @@ jobs:
./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build"
docker compose down
- name: Test PostgreSQL Driver - postgres 17
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_POSTGRESQL: "1"
Expand All @@ -299,7 +280,6 @@ jobs:
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- name: Get Date
id: get-date
shell: bash
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
- name: Cache Conda
Expand All @@ -313,13 +293,11 @@ jobs:
use-only-tar-bz2: false
use-mamba: true
- name: Install Dependencies
shell: bash -l {0}
run: |
mamba install -c conda-forge \
--file ci/conda_env_cpp.txt \
--file ci/conda_env_python.txt
- name: Work around ASAN issue (GH-1617)
shell: bash -l {0}
run: |
sudo sysctl vm.mmap_rnd_bits=28
- uses: actions/setup-go@v5
Expand All @@ -329,7 +307,6 @@ jobs:
cache: true
cache-dependency-path: go/adbc/go.sum
- name: Build and Test Snowflake Driver
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_SNOWFLAKE: "1"
Expand All @@ -338,7 +315,6 @@ jobs:
./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
./ci/scripts/cpp_test.sh "$(pwd)/build"
- name: Build and Test Snowflake Driver (Python)
shell: bash -l {0}
env:
BUILD_ALL: "0"
BUILD_DRIVER_MANAGER: "1"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ concurrency:
permissions:
contents: read

defaults:
run:
shell: bash -l -eo pipefail {0}

jobs:
java:
name: "Java ${{ matrix.java }}/Linux"
Expand All @@ -55,7 +59,6 @@ jobs:
distribution: "temurin"
java-version: ${{ matrix.java }}
- name: Start test services
shell: bash -l {0}
run: |
docker compose up --detach --wait flightsql-sqlite-test mssql-test postgres-test
cat .env | grep -v -e '^#' | awk NF | tee -a $GITHUB_ENV
Expand Down
Loading

0 comments on commit 196522b

Please sign in to comment.