Skip to content

Commit 82afc33

Browse files
committed
[WIP]
1 parent 3ef930f commit 82afc33

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
name: Test
3+
4+
on:
5+
push:
6+
branches:
7+
- "**"
8+
pull_request:
9+
branches:
10+
- master
11+
workflow_dispatch:
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-22.04
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-22.04]
21+
pg: [12, 13, 14, 15, 16, 17]
22+
tests: [sql]
23+
build: [automake, meson]
24+
25+
name: ${{ format('Shared_ispell ({0}, PostgreSQL {1}, {2} tests, {3} build)', matrix.os, matrix.pg, matrix.tests, matrix.build) }}
26+
container:
27+
image: ${{ format('ghcr.io/postgres-dev/{0}:1.0', matrix.os) }}
28+
env:
29+
PG_BRANCH: ${{ format('REL_{0}_STABLE', matrix.pg_version) }}
30+
PGDATA: $HOME/data
31+
TEST_MODE: ${{ matrix.test_mode }}
32+
options: --privileged
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Install build tools
39+
run: |
40+
sudo apt update
41+
sudo apt install -y \
42+
build-essential \
43+
automake \
44+
meson \
45+
ninja-build \
46+
pkg-config \
47+
libxml2-dev \
48+
wget \
49+
gnupg \
50+
lsb-release
51+
52+
- name: Set PG_CONFIG
53+
run: echo "PG_CONFIG=$(which pg_config)" >> $GITHUB_ENV
54+
55+
- name: Wait for PostgreSQL
56+
run: |
57+
for i in {1..30}; do
58+
if pg_isready -h localhost -p 5432 -U postgres; then
59+
echo "Postgres is ready!"
60+
break
61+
fi
62+
echo "Waiting for Postgres..."
63+
sleep 2
64+
done
65+
66+
- name: Build (automake)
67+
if: matrix.build == 'automake'
68+
run: |
69+
make USE_PGXS=1
70+
make USE_PGXS=1 install
71+
72+
- name: Build (meson)
73+
if: matrix.build == 'meson'
74+
run: |
75+
PREFIX=$($PG_CONFIG --pgxs | sed 's|/lib/pgxs/src/makefiles/pgxs.mk||')
76+
meson setup builddir --prefix=$PREFIX
77+
meson compile -C builddir
78+
meson install -C builddir
79+
80+
- name: Create extension
81+
run: |
82+
psql -h localhost -U postgres -d test \
83+
-c "CREATE EXTENSION shared_ispell;"
84+
85+
- name: Run SQL tests
86+
run: |
87+
for f in sql/*.sql; do
88+
echo "Running $f"
89+
psql -h localhost -U postgres -d test -f "$f"
90+
done

0 commit comments

Comments
 (0)