Skip to content

Commit

Permalink
actions: build & publish for Pg14 and 16 (#197)
Browse files Browse the repository at this point in the history
* actions: build & publish for Pg14 and 16

* bump postgres version in ci

* debug

* dont overwrite

---------

Co-authored-by: Adam Hendel <[email protected]>
  • Loading branch information
vrmiguel and ChuckHend committed Feb 22, 2024
1 parent d41370c commit e00e716
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/extension_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:
fail-fast: false
matrix:
pg: [
{version: "12.17", pgrx_version: "pg12"},
{version: "13.13", pgrx_version: "pg13"},
{version: "14.10", pgrx_version: "pg14"},
{version: "15.5", pgrx_version: "pg15"},
{version: "16.1", pgrx_version: "pg16"}
{version: "12.18", pgrx_version: "pg12"},
{version: "13.14", pgrx_version: "pg13"},
{version: "14.11", pgrx_version: "pg14"},
{version: "15.6", pgrx_version: "pg15"},
{version: "16.2", pgrx_version: "pg16"}
]
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -109,6 +109,9 @@ jobs:
publish:
name: trunk publish
runs-on: ubuntu-22.04
strategy:
matrix:
pg-version: [14, 15, 16]
steps:
- uses: actions/checkout@v2
- name: Install Rust stable toolchain
Expand All @@ -134,7 +137,7 @@ jobs:
cargo install pg-trunk
- name: trunk build
working-directory: ./
run: trunk build --pg-version 15
run: trunk build --pg-version ${{ matrix.pg-version }}
- name: trunk publish
# only publish release events
if: github.event_name == 'release'
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/extension_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
git clone https://github.com/pgpartman/pg_partman.git && \
cd pg_partman && \
git checkout v4.7.4 && \
sed -i 's|PG_CONFIG = pg_config|PG_CONFIG = ~/.pgrx/15.5/pgrx-install/bin/pg_config|' Makefile && \
sed -i 's|PG_CONFIG = pg_config|PG_CONFIG = ~/.pgrx/15.6/pgrx-install/bin/pg_config|' Makefile && \
make && \
make install && \
ls -alh /home/runner/.pgrx/15.5/pgrx-install/share/postgresql/extension/pg_partman*
ls -alh /home/runner/.pgrx/15.6/pgrx-install/share/postgresql/extension/pg_partman*
- name: Run old version (1.0.0)
run: |
rm -rf ./target/pgrx-test-data-* || true
Expand All @@ -72,19 +72,15 @@ jobs:
psql $DATABASE_URL -c "CREATE EXTENSION pgmq;"
psql $DATABASE_URL -c "select * from pgmq.create('test_queue_1')"
psql $DATABASE_URL -c "select * from pgmq.create_partitioned('test_partitioned_queue_1');"
ls -alh /home/runner/.pgrx/15.5/pgrx-install/share/postgresql/extension/pg_partman*
ls -alh /home/runner/.pgrx/15.6/pgrx-install/share/postgresql/extension/pg_partman*
- name: Checkout branch's version
env:
CI_BRANCH: ${{ steps.current-version.outputs.CI_BRANCH }}
run: |
git checkout $CI_BRANCH
- uses: ./.github/actions/pgx-init
with:
working-directory: ./
force: true
- name: Upgrade and run tests
run: |
ls -alh /home/runner/.pgrx/15.5/pgrx-install/share/postgresql/extension/pg_partman*
ls -alh /home/runner/.pgrx/15.6/pgrx-install/share/postgresql/extension/pg_partman*
export DATABASE_URL=postgres://$USER:postgres@localhost:28815/pgmq
SQLX_OFFLINE=true cargo pgrx run ${pg_version} --pgcli || true
psql $DATABASE_URL -c "ALTER EXTENSION pgmq UPDATE;"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
PGRX_POSTGRES ?= pg15
DISTNAME = $(shell grep -m 1 '^name' Cargo.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/')
DISTVERSION = $(shell grep -m 1 '^version' Cargo.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/')
PG_VERSION:=15
PGRX_PG_CONFIG =$(shell cargo pgrx info pg-config ${PGRX_POSTGRES})

test:
cargo pgrx test $(PGRX_POSTGRES)
Expand Down

0 comments on commit e00e716

Please sign in to comment.