Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jobs:
name: 🐘 PGXS on Postgres ${{ matrix.pg }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg: [17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4, 9.3, 9.2, 9.1, '9.0', 8.4, 8.3, 8.2]
pg: [18, 17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4, 9.3, 9.2, 9.1, '9.0', 8.4, 8.3, 8.2]
steps:
- uses: actions/checkout@v4
- name: Build Image
Expand All @@ -19,28 +20,30 @@ jobs:
- name: Test with system UID
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" -e AS_USER=pgxn_worker -e LOCAL_UID=$(id -u) pgxn-tools-test ./test/pgxs/runtest.sh ${{ matrix.pg }}"
- name: Test as root
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgxs/runtest.sh ${{ matrix.pg }} hello"
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgxs/runtest.sh ${{ matrix.pg }}"

pgrx:
name: 🦀 pgrx on Postgres ${{ matrix.pg }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg: [17, 16, 15, 14, 13, 12]
pg: [18, 17, 16, 15, 14, 13]
steps:
- uses: actions/checkout@v4
- name: Build Image
run: docker build -t pgxn-tools-test .
# First test system UID, otherwise it can't use files touched by root.
- name: Test with system UID
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" -e AS_USER=pgxn_worker -e LOCAL_UID=$(id -u) pgxn-tools-test ./test/pgrx/runtest.sh ${{ matrix.pg }}"
# - name: Test with system UID
# run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" -e AS_USER=pgxn_worker -e LOCAL_UID=$(id -u) pgxn-tools-test ./test/pgrx/runtest.sh ${{ matrix.pg }}"
- name: Test as root
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgrx/runtest.sh ${{ matrix.pg }}"
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgrx/runtest.sh ${{ matrix.pg }} hello"

bundle:
name: ${{ matrix.util.icon }} Bundle with ${{ matrix.util.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
util:
- { icon: 🏷️, name: git, dir: "", run: ./test/pgxs }
Expand All @@ -51,12 +54,12 @@ jobs:
- name: Build Image
run: docker build -t pgxn-tools-test .
- name: Test ${{ matrix.util.name }}
run: "docker run -w /repo --rm --volume \"$(pwd)${{ matrix.util.dir }}:/repo\" pgxn-tools-test ${{ matrix.util.run }}/runtest.sh ${{ env.PG_VERSION }} ${{ matrix.util[1] }}"
run: "docker run -w /repo --rm --volume \"$(pwd)${{ matrix.util.dir }}:/repo\" pgxn-tools-test ${{ matrix.util.run }}/runtest.sh ${{ env.PG_VERSION }} ${{ matrix.util.name }}"
- name: Test ${{ matrix.util.name }} with extra file
run: "docker run -w /repo --rm --volume \"$(pwd)${{ matrix.util.dir }}:/repo\" pgxn-tools-test ${{ matrix.util.run }}/runtest.sh ${{ env.PG_VERSION }} ${{ matrix.util[1] }} yes"
run: "docker run -w /repo --rm --volume \"$(pwd)${{ matrix.util.dir }}:/repo\" pgxn-tools-test ${{ matrix.util.run }}/runtest.sh ${{ env.PG_VERSION }} ${{ matrix.util.name }} yes"
- name: Test ${{ matrix.util.name }} with archive-all
env: { GIT_ARCHIVE_CMD: archive-all }
run: "docker run -w /repo --rm --volume \"$(pwd)${{ matrix.util.dir }}:/repo\" pgxn-tools-test ${{ matrix.util.run }}/runtest.sh ${{ env.PG_VERSION }} ${{ matrix.util[1] }}"
run: "docker run -w /repo --rm --volume \"$(pwd)${{ matrix.util.dir }}:/repo\" pgxn-tools-test ${{ matrix.util.run }}/runtest.sh ${{ env.PG_VERSION }} ${{ matrix.util.name }}"
- name: Test NO_CLUSTER
run: "docker run -w /repo -e NO_CLUSTER=1 --rm --volume \"$(pwd)${{ matrix.util.dir }}:/repo\" pgxn-tools-test ${{ matrix.util.run }}/no_cluster_test.sh ${{ env.PG_VERSION }}"

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bookworm-slim AS pgxn-config
FROM debian:trixie-slim AS pgxn-config

ADD https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/apt.postgresql.org.sh /usr/local/bin/

Expand Down Expand Up @@ -36,6 +36,6 @@ RUN chmod +x /usr/local/bin/apt.postgresql.org.sh \

COPY bin/* /usr/local/bin/

ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 CARGO_HOME=/usr/share/cargo PGRX_HOME=/tmp/.pgrx RUSTUP_HOME=/usr/share/rustup PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/share/cargo/bin
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 PGUSER=postgres CARGO_HOME=/usr/share/cargo PGRX_HOME=/tmp/.pgrx RUSTUP_HOME=/usr/share/rustup PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/share/cargo/bin
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/bin/bash"]
6 changes: 4 additions & 2 deletions bin/pg-build-test
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ set -eux

# set PROFILE to a default of -Werror, otherwise use the passed in value. Note
# the double dash is intentional.
export PROFILE="${PROFILE:--Werror}"
PROFILE="${PROFILE:--Werror}"
MAKEFLAGS="-j $(nproc)"
export PROFILE MAKEFLAGS

make all
sudo make install
status=0
make installcheck PGUSER=postgres || status=$?
make installcheck || status=$?
[ $status != 0 ] && find . -name regression.diffs -exec cat {} +
exit $status
7 changes: 6 additions & 1 deletion bin/pgrx-build-test
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ exit unless $regress;

# Run installcheck.
say "### Running installcheck for $package";
run [qw(make installcheck PGUSER=postgres)] or do {
my $nproc = do {
run [qw(nproc)], \undef, \my $out;
chomp $out;
$out || 1;
};
run [qw(make installcheck -j), $nproc] or do {
my $exit_code = $? >> 8;
# Try to find regression.diffs.
run[qw(find . -name regression.diffs -exec cat {} +)];
Expand Down
12 changes: 4 additions & 8 deletions test/pgrx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ edition = "2021"
[lib]
crate-type = ["cdylib", "lib"]

# https://github.com/pgcentralfoundation/pgrx/issues/1966
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(pgrx_embed)"] }

[features]
default = ["pg17"]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
default = ["pg18"]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
pg15 = ["pgrx/pg15", "pgrx-tests/pg15" ]
pg16 = ["pgrx/pg16", "pgrx-tests/pg16" ]
pg17 = ["pgrx/pg17", "pgrx-tests/pg17" ]
pg18 = ["pgrx/pg18", "pgrx-tests/pg18" ]
pg_test = []

[dependencies]
pgrx = "0.12.9"
pgrx = "0.16.1"

[dev-dependencies]
pgrx-tests = "0.12.9"
pgrx-tests = "0.16.1"

[profile.dev]
panic = "unwind"
Expand Down
Loading