Fix CI: use PGDG setup script and postgresql-contrib-18 #151
Workflow file for this run
This file contains hidden or 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: make installcheck | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| test: | |
| name: PostgreSQL 18 + Rust | |
| runs-on: ubuntu-24.04 | |
| env: | |
| PG_CONFIG: /usr/lib/postgresql/18/bin/pg_config | |
| steps: | |
| - name: Install PostgreSQL 18 from PGDG | |
| run: | | |
| sudo apt-get install -y postgresql-common ca-certificates | |
| sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y | |
| sudo apt-get install -y postgresql-18 postgresql-server-dev-18 postgresql-contrib-18 libclang-dev build-essential pkg-config | |
| - name: Start PostgreSQL 18 | |
| run: | | |
| sudo pg_ctlcluster 18 main start | |
| sudo -u postgres createuser -s $(whoami) | |
| - name: Add pg_config to PATH | |
| run: echo "/usr/lib/postgresql/18/bin" >> $GITHUB_PATH | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Build and install C extension | |
| run: | | |
| make PG_CONFIG=${{ env.PG_CONFIG }} | |
| sudo make install PG_CONFIG=${{ env.PG_CONFIG }} | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: native -> target | |
| - name: Install cargo-pgrx and build Rust extension | |
| run: | | |
| cargo install --locked cargo-pgrx --version 0.16.1 | |
| cargo pgrx init --pg18=${{ env.PG_CONFIG }} | |
| cd native | |
| sudo --preserve-env=PATH cargo pgrx install --release --pg-config=${{ env.PG_CONFIG }} | |
| - name: Run regression tests | |
| run: make installcheck PG_CONFIG=${{ env.PG_CONFIG }} | |
| - name: Show regression diffs on failure | |
| if: failure() | |
| run: | | |
| if [ -f regression.diffs ]; then cat regression.diffs; fi |