Skip to content

Commit

Permalink
use git sha for postgres build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
wuputah committed Sep 27, 2024
1 parent f6bf518 commit e5b509f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ jobs:
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]
os: [ubuntu-24.04]
version: [REL_16_STABLE, REL_17_STABLE]
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -81,26 +82,33 @@ jobs:
submodules: 'recursive'
path: duckdb

- name: Compute DuckDB SHA
- name: Checkout PostgreSQL code
rm -rf postgres
git clone --branch ${{ matrix.version }} --single-branch --depth 1 https://github.com/postgres/postgres.git

- name: Compute Version SHAs
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}'"
popd
pushd postgres
POSTGRES_SHA=`git ls-tree HEAD --format='%(objectname)'`
echo "postgres_sha=${POSTGRES_SHA}" >> "$GITHUB_OUTPUT"
echo "Got POSTGRES_SHA='${POSTGRES_SHA}'"
- name: Setup PG build cache
id: cache-pg-build
uses: actions/cache@v4
with:
path: postgres/inst
key: pg-build-${{ matrix.version }}
key: pg-build-${{ steps.versions.outputs.postgres_sha }}

- name: Checkout and build PostgreSQL code
- name: 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
Expand Down

0 comments on commit e5b509f

Please sign in to comment.