Skip to content

Commit

Permalink
Switch from pgxn-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Apr 3, 2024
1 parent 57735a5 commit 13ab5cf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
26 changes: 26 additions & 0 deletions .ci/apt-install-postgres
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -e

# Determine the version of PostgreSQL (and append .0 to a single digit)
if [ -z ${1+x} ]; then
echo "ERROR: No PostgreSQL version number passed to $0"
echo "Usage:"
echo " $0 \$PGVERSION"
exit 2
fi

PGVERSION=${1:-}
[[ $PGVERSION =~ ^[0-9]$ ]] && PGVERSION+=.0

apt-get update
apt-get install -y --no-install-recommends \
build-essential clang llvm llvm-dev llvm-runtime cmake \
ca-certificates gnupg2 curl libicu-dev libxml2 locales ssl-cert
apt-get -y purge postgresql-client-common

curl https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/apt.postgresql.org.sh -O --output-dir /usr/local/bin/
chmod +x /usr/local/bin/apt.postgresql.org.sh

apt.postgresql.org.sh -i -v "$PGVERSION"
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y "${@:2}"
15 changes: 7 additions & 8 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,27 @@ jobs:

test:
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
strategy:
fail-fast: false
matrix:
pg: [11, 12, 13, 14, 15, 16]
pg: [16] # [11, 12, 13, 14, 15, 16, 17]
os: [[🐧, Ubuntu]] # , [🍎, macOS], [🪟, Windows]]
name: 🐘 Postgres ${{ matrix.pg }} on ${{ matrix.os[0] }} ${{ matrix.os[1] }}
steps:
- uses: actions/checkout@v2
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Start Postgres ${{ matrix.pg }}
run: pg-start ${{ matrix.pg }}
- name: Setup Cache
with: { toolchain: stable }
- name: Install Postgres ${{ matrix.pg }}
run: sudo ./.ci/apt-install-postgres ${{ matrix.pg }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with: { cache-directories: /home/runner/.pgrx }
- name: Install pgrx
run: cargo install cargo-pgrx --version "$(perl -ne 'print $1 if /^pgrx\s+=\s"=?([^"]+)/' Cargo.toml)" --locked
- name: Initialize pgrx
run: cargo pgrx init --pg${{ matrix.pg }}="$(which pg_config)"
- name: Fix permissisons
run: chmod a+rwx "$(pg_config --pkglibdir)" "$(pg_config --sharedir)/extension"
- name: Run the tests
env:
RUST_BACKTRACE: 1
Expand Down

0 comments on commit 13ab5cf

Please sign in to comment.