-
Notifications
You must be signed in to change notification settings - Fork 6
107 lines (93 loc) · 2.84 KB
/
test.yml
File metadata and controls
107 lines (93 loc) · 2.84 KB
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
name: Standard extension's make check
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: PG ${{ matrix.pg_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg_version: [17, 18]
steps:
- name: Checkout extension code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libreadline-dev \
zlib1g-dev \
flex \
bison \
libxml2-dev \
libxslt-dev \
libssl-dev \
libxml2-utils \
xsltproc \
ccache
- name: Get PostgreSQL branch HEAD SHA
id: pg-sha
run: |
if [ "${{ matrix.pg_version }}" = "master" ]; then
BRANCH="master"
else
BRANCH="REL_${{ matrix.pg_version }}_STABLE"
fi
SHA=$(git ls-remote https://github.com/postgres/postgres.git refs/heads/$BRANCH | cut -f1)
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Cache PostgreSQL build
uses: actions/cache@v4
id: pg-cache
with:
path: ~/postgresql
key: ${{ runner.os }}-pg-${{ matrix.pg_version }}-${{ steps.pg-sha.outputs.sha }}
- name: Clone PostgreSQL
if: steps.pg-cache.outputs.cache-hit != 'true'
run: |
cd ~
if [ "${{ matrix.pg_version }}" = "master" ]; then
git clone --depth 1 --branch master https://github.com/postgres/postgres.git postgresql
else
git clone --depth 1 --branch REL_${{ matrix.pg_version }}_STABLE https://github.com/postgres/postgres.git postgresql
fi
- name: Build PostgreSQL
if: steps.pg-cache.outputs.cache-hit != 'true'
run: |
cd ~/postgresql
./configure --prefix=$HOME/postgresql/inst --enable-debug --enable-cassert --enable-depend
make -j$(nproc)
make install
- name: Add PostgreSQL to PATH
run: |
echo "$HOME/postgresql/inst/bin" >> $GITHUB_PATH
echo "PG_CONFIG=$HOME/postgresql/inst/bin/pg_config" >> $GITHUB_ENV
- name: Build extension
run: |
export PATH="$HOME/postgresql/inst/bin:$PATH"
make USE_PGXS=1 clean
make USE_PGXS=1
- name: Run regression tests
run: |
export PATH="$HOME/postgresql/inst/bin:$PATH"
make USE_PGXS=1 check
- name: Show regression diffs on failure
if: failure()
run: |
if [ -f regression.diffs ]; then
cat regression.diffs
fi
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: regression-diffs-pg${{ matrix.pg_version }}
path: |
regression.diffs
regression.out
results/
if-no-files-found: ignore