Skip to content

Commit

Permalink
Update pgrx and tests for Postgres 17
Browse files Browse the repository at this point in the history
Also add stuff to `test/pgrx/Makefile` to jog the memory next time.
  • Loading branch information
theory committed Jan 6, 2025
1 parent c22ce9c commit a311759
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pg: [16, 15, 14, 13, 12, 11]
pg: [17, 16, 15, 14, 13, 12]
steps:
- uses: actions/checkout@v4
- name: Build Image
Expand Down
10 changes: 5 additions & 5 deletions test/pgrx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]
crate-type = ["cdylib", "lib"]

[features]
default = ["pg13"]
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ]
default = ["pg17"]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
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" ]
pg_test = []

[dependencies]
pgrx = "=0.11.4"
pgrx = "0.12.9"

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

[profile.dev]
panic = "unwind"
Expand Down
19 changes: 19 additions & 0 deletions test/pgrx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,22 @@ PG_CONFIG = pg_config

PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

.PHONY: upgrade-pgrx # Upgrade to the current version of PGRX.
upgrade-pgrx:
cargo pgrx upgrade

.PHONY: install-pgrx # Install the version of PGRX listed in Cargo.toml
install-pgrx: Cargo.toml
cargo install cargo-pgrx --version "$$(perl -nE '/^pgrx\s+=\s"=?([^"]+)/ && do { say $$1; exit }' Cargo.toml)" --locked

.PHONY: pgrx-init # Initialize pgrx for the PostgreSQL version identified by pg_config.
pgrx-init: Cargo.toml
@cargo pgrx init "--pg$$(perl -E 'shift =~ /(\d+)/ && say $$1' "$$($(PG_CONFIG) --version)")"="$(PG_CONFIG)"

.PHONY: test # Run the full test suite against the PostgreSQL version identified by pg_config.
test:
@cargo test --all --no-default-features --features "pg$(PGV) pg_test" -- --nocapture

package:
@cargo pgrx package --pg-config "$(PG_CONFIG)"

0 comments on commit a311759

Please sign in to comment.