Add GitHub workflow
authorChristoph Berg <christoph.berg@credativ.de>
Wed, 16 Mar 2022 13:34:36 +0000 (14:34 +0100)
committerChristoph Berg <christoph.berg@credativ.de>
Wed, 16 Mar 2022 14:45:18 +0000 (15:45 +0100)
Only test PostgreSQL 14 and 15 since older versions do not support all
datatype values.

.github/workflows/ci.yml [new file with mode: 0644]

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644 (file)
index 0000000..1866003
--- /dev/null
@@ -0,0 +1,27 @@
+name: CI
+on: [push, pull_request]
+
+jobs:
+  test:
+
+    strategy:
+      matrix:
+        pg:
+          - 15
+          - 14
+          # versions before 14 no not support Infinity in numeric
+          # versions before 12 have a different output format for floats (inf/Infinity, nan/NaN)
+
+    name: ๐Ÿ˜ PostgreSQL ${{ matrix.pg }}
+    runs-on: ubuntu-latest
+    container: pgxn/pgxn-tools
+
+    steps:
+      - name: Start PostgreSQL ${{ matrix.pg }}
+        run: pg-start ${{ matrix.pg }}
+      - name: Check out the repo
+        uses: actions/checkout@v2
+      - name: Install extra build dependencies
+        run: sudo apt-get install -y liblz4-dev
+      - name: Build and test on PostgreSQL ${{ matrix.pg }}
+        run: PATH=$PATH:/usr/lib/postgresql/${{ matrix.pg }}/bin pg-build-test