Skip to content

Commit 9a903b4

Browse files
committed
[WIP]
1 parent 3ef930f commit 9a903b4

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/test.yml

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

0 commit comments

Comments
 (0)