Skip to content

Commit 5d3c0e1

Browse files
committed
Upgrade to trixie, set MAKEFLAGS, PGUSER
* Upgrade to `trixie-slim` * Set `PGUSER` to `postgres` in the `Dockerfile`, removing the need for users to remember to do it. * Set `MAKEFLAGS="-j $(nprocs)"` in `pgxn-build-test` and pass `-j $(nprocs)` in `pgrx-build-test` to shorten build runtimes * Upgrade the pgrx test extension to v0.16.1 and test it on Postgres versions 13-16. * Let all the test configurations run, rather than fail fast, to more easily identify version and configuration issues. * Properly test the pgrx package argument added in 6c143b2.
1 parent beb20f2 commit 5d3c0e1

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

.github/workflows/cicd.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ jobs:
99
name: 🐘 PGXS on Postgres ${{ matrix.pg }}
1010
runs-on: ubuntu-latest
1111
strategy:
12+
fail-fast: false
1213
matrix:
13-
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]
14+
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]
1415
steps:
1516
- uses: actions/checkout@v4
1617
- name: Build Image
@@ -19,14 +20,15 @@ jobs:
1920
- name: Test with system UID
2021
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 }}"
2122
- name: Test as root
22-
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgxs/runtest.sh ${{ matrix.pg }} hello"
23+
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgxs/runtest.sh ${{ matrix.pg }}"
2324

2425
pgrx:
2526
name: 🦀 pgrx on Postgres ${{ matrix.pg }}
2627
runs-on: ubuntu-latest
2728
strategy:
29+
fail-fast: false
2830
matrix:
29-
pg: [17, 16, 15, 14, 13, 12]
31+
pg: [18, 17, 16, 15, 14, 13]
3032
steps:
3133
- uses: actions/checkout@v4
3234
- name: Build Image
@@ -35,12 +37,13 @@ jobs:
3537
- name: Test with system UID
3638
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 }}"
3739
- name: Test as root
38-
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgrx/runtest.sh ${{ matrix.pg }}"
40+
run: "docker run -w /repo --rm --volume \"$(pwd):/repo\" pgxn-tools-test ./test/pgrx/runtest.sh ${{ matrix.pg }} hello"
3941

4042
bundle:
4143
name: ${{ matrix.util.icon }} Bundle with ${{ matrix.util.name }}
4244
runs-on: ubuntu-latest
4345
strategy:
46+
fail-fast: false
4447
matrix:
4548
util:
4649
- { icon: 🏷️, name: git, dir: "", run: ./test/pgxs }

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bookworm-slim AS pgxn-config
1+
FROM debian:trixie-slim AS pgxn-config
22

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

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

3737
COPY bin/* /usr/local/bin/
3838

39-
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
39+
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
4040
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
4141
CMD ["/bin/bash"]

bin/pg-build-test

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ set -eux
66

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

1113
make all
1214
sudo make install
1315
status=0
14-
make installcheck PGUSER=postgres || status=$?
16+
make installcheck || status=$?
1517
[ $status != 0 ] && find . -name regression.diffs -exec cat {} +
1618
exit $status

bin/pgrx-build-test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ exit unless $regress;
9292

9393
# Run installcheck.
9494
say "### Running installcheck for $package";
95-
run [qw(make installcheck PGUSER=postgres)] or do {
95+
my $nproc = do {
96+
run [qw(nproc)], \undef, \my $out;
97+
chomp $out;
98+
$out || 1;
99+
};
100+
run [qw(make installcheck -j), $nproc] or do {
96101
my $exit_code = $? >> 8;
97102
# Try to find regression.diffs.
98103
run[qw(find . -name regression.diffs -exec cat {} +)];

test/pgrx/Cargo.toml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ edition = "2021"
66
[lib]
77
crate-type = ["cdylib", "lib"]
88

9-
# https://github.com/pgcentralfoundation/pgrx/issues/1966
10-
[lints.rust]
11-
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(pgrx_embed)"] }
12-
139
[features]
14-
default = ["pg17"]
15-
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
10+
default = ["pg18"]
1611
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
1712
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
1813
pg15 = ["pgrx/pg15", "pgrx-tests/pg15" ]
1914
pg16 = ["pgrx/pg16", "pgrx-tests/pg16" ]
2015
pg17 = ["pgrx/pg17", "pgrx-tests/pg17" ]
16+
pg18 = ["pgrx/pg18", "pgrx-tests/pg18" ]
2117
pg_test = []
2218

2319
[dependencies]
24-
pgrx = "0.12.9"
20+
pgrx = "0.16.1"
2521

2622
[dev-dependencies]
27-
pgrx-tests = "0.12.9"
23+
pgrx-tests = "0.16.1"
2824

2925
[profile.dev]
3026
panic = "unwind"

0 commit comments

Comments
 (0)