add create_unlogged to python API. batch mode to benches #261
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PGMQ Extension Upgrade | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./ | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- 'pgmq-rs/**' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'pgmq-rs/**' | |
release: | |
types: | |
- created | |
jobs: | |
test: | |
name: Upgrade Test | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: "pgmq-extension-upgrade-test" | |
workspaces: | | |
pgmq | |
# Additional directories to cache | |
cache-directories: | | |
/home/runner/.pgrx | |
- name: Get current version | |
id: current-version | |
run: echo "CI_BRANCH=$(git name-rev --name-only HEAD)" >> $GITHUB_OUTPUT | |
- name: Checkout old version (0.14.2) | |
run: | | |
git fetch --tags | |
git checkout tags/v0.14.2 | |
- uses: ./.github/actions/pgx-init | |
with: | |
working-directory: ./ | |
force: true | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y postgresql-server-dev-14 | |
- name: Install pg_partman | |
run: | | |
git clone https://github.com/pgpartman/pg_partman.git && \ | |
cd pg_partman && \ | |
git checkout v4.7.4 && \ | |
sudo make install && cd ../ | |
cp /usr/share/postgresql/14/extension/pg_partman* ~/.pgrx/15.4/pgrx-install/share/postgresql/extension/ | |
cp /usr/lib/postgresql/14/lib/pg_partman_bgw.so ~/.pgrx/15.4/pgrx-install/lib/postgresql/ | |
- name: Run old version (0.14.2) | |
run: | | |
rm -rf ./target/pgrx-test-data-* || true | |
pg_version=$(stoml Cargo.toml features.default) | |
SQLX_OFFLINE=true cargo pgrx run ${pg_version} --pgcli || true | |
export DATABASE_URL=postgres://$USER:postgres@localhost:28815/pgmq | |
psql $DATABASE_URL -c "DROP EXTENSION IF EXISTS pgmq CASCADE;" | |
psql $DATABASE_URL -c "DROP EXTENSION IF EXISTS pg_partman CASCADE;" | |
psql $DATABASE_URL -c "CREATE EXTENSION pg_partman;" | |
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');" | |
- 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: | | |
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;" | |
SQLX_OFFLINE=true make test |