-
Notifications
You must be signed in to change notification settings - Fork 56
132 lines (113 loc) · 4.09 KB
/
build_and_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI
on:
push:
branches: ["main"]
tags: ["v*"]
pull_request:
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:
version: [REL_14_STABLE, REL_15_STABLE, REL_16_STABLE, REL_17_STABLE]
runs-on: ubuntu-24.04
steps:
- name: Test details
run: echo Build and test pg_duckdb 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 libtinfo6 cmake \
libstdc++-12-dev ninja-build
echo "${PWD}/postgres/inst/bin:$PATH'" > $GITHUB_PATH
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ubuntu-24.04-${{ matrix.version }}
create-symlink: true
- name: Checkout pg_duckdb extension code
uses: actions/checkout@v4
with:
submodules: "recursive"
path: duckdb
- name: Checkout PostgreSQL code
run: |
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/third_party/duckdb
DUCKDB_SHA=`git rev-parse HEAD`
echo "duckdb_sha=${DUCKDB_SHA}" >> "$GITHUB_OUTPUT"
echo "Got DUCKDB_SHA='${DUCKDB_SHA}'"
popd
pushd postgres
POSTGRES_SHA=`git rev-parse HEAD`
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-ubuntu-24.04-${{ steps.versions.outputs.postgres_sha }}
- name: Build PostgreSQL code
if: steps.cache-pg-build.outputs.cache-hit != 'true'
run: |
pushd postgres
git branch
./configure --prefix=$PWD/inst/ --enable-cassert --enable-debug --with-openssl --with-icu --with-libxml --with-lz4
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-ubuntu-24.04-${{ steps.versions.outputs.duckdb_sha }}-ninja
- 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 -j8 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