Fix for pg_duckdb cache invalidation #660
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: ["main"] | |
tags: ["v*"] | |
paths: | |
- 'src/**' | |
- 'test/**' | |
- 'include/**' | |
- 'sql/**' | |
- Makefile | |
- Makefile.global | |
- duckdb.control | |
- third_party/duckdb | |
- '.github/workflows/**' | |
pull_request: | |
paths: | |
- 'src/**' | |
- 'test/**' | |
- 'include/**' | |
- 'sql/**' | |
- Makefile | |
- Makefile.global | |
- duckdb.control | |
- third_party/duckdb | |
- '.github/workflows/**' | |
- .clang-format | |
jobs: | |
format: | |
runs-on: ubuntu-24.04 | |
name: 'Linting and formatting' | |
steps: | |
- name: Checkout pg_duckdb extension code | |
uses: actions/checkout@v4 | |
- name: Fetch main branch | |
run: git fetch --depth=1 origin +main:refs/remotes/origin/main | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install clang-format (11.0.1) and ruff | |
run: python3 -m pip install "clang-format==11.0.1" ruff | |
- name: Run clang-format | |
run: git clang-format refs/remotes/origin/main --diff | |
- name: Run ruff check | |
run: ruff check --output-format=github . | |
- name: Run ruff format | |
run: ruff format --diff | |
build-and-test: | |
name: 'Build and test' | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
version: [REL_16_STABLE, REL_17_STABLE] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Test details | |
run: echo Build and test pg_duckdb on ${{ matrix.os }} with PostgreSQL ${{ matrix.version }} branch | |
- name: Install build deps | |
run: | | |
sudo apt-get update -qq | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 | |
sudo apt-get install -y build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev \ | |
libssl-dev libxml2-utils xsltproc pkg-config libc++-dev libc++abi-dev libglib2.0-dev libtinfo5 cmake \ | |
libstdc++-12-dev | |
echo "${PWD}/postgres/inst/bin:$PATH'" > $GITHUB_PATH | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
create-symlink: true | |
- name: Checkout pg_duckdb extension code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
path: duckdb | |
- name: Compute DuckDB SHA | |
id: versions | |
run: | | |
pushd duckdb | |
DUCKDB_SHA=`git ls-tree HEAD third_party/duckdb --format='%(objectname)'` | |
echo "duckdb_sha=${DUCKDB_SHA}" >> "$GITHUB_OUTPUT" | |
echo "Got DUCKDB_SHA='${DUCKDB_SHA}'" | |
- name: Setup PG build cache | |
id: cache-pg-build | |
uses: actions/cache@v4 | |
with: | |
path: postgres/inst | |
key: pg-build-${{ matrix.version }} | |
- name: Checkout and build PostgreSQL code | |
if: steps.cache-pg-build.outputs.cache-hit != 'true' | |
run: | | |
rm -rf postgres | |
git clone --branch ${{ matrix.version }} --single-branch --depth 1 https://github.com/postgres/postgres.git | |
pushd postgres | |
git branch | |
./configure --prefix=$PWD/inst/ --enable-cassert --enable-debug --with-openssl --with-icu --with-libxml | |
make -j8 install | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Setup DuckDB build cache | |
id: cache-duckdb-build | |
uses: actions/cache@v4 | |
with: | |
path: duckdb/third_party/duckdb/build/ | |
key: duckdb-build-${{ steps.versions.outputs.duckdb_sha }} | |
- name: Install pytest and other test requirements | |
run: python3 -m pip install -r duckdb/requirements.txt | |
- name: Build and test pg_duckdb extension | |
id: build | |
run: | | |
pushd duckdb | |
make | |
make install | |
- name: Run make installcheck | |
id: installcheck | |
run: | | |
pushd duckdb | |
make installcheck | |
- name: Run make pycheck | |
id: pycheck | |
run: | | |
pushd duckdb | |
make pycheck | |
- name: Print regression.diffs if regression tests failed | |
if: failure() && steps.installcheck.outcome != 'success' | |
run: | | |
cat duckdb/test/regression/regression.diffs |