-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.91 KB
/
Copy pathtests.yml
File metadata and controls
49 lines (41 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: tests
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
jobs:
pgrx:
name: cargo pgrx test (pg18)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Add PGDG repo and build deps
run: |
set -e
sudo install -d /usr/share/postgresql-common/pgdg
sudo curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \
-o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc
. /etc/os-release
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt ${VERSION_CODENAME}-pgdg main" \
| sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
postgresql-18 postgresql-server-dev-18 build-essential clang libclang-dev pkg-config
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Install cargo-pgrx
run: cargo install cargo-pgrx --version 0.18.1 --locked
- name: Initialize pgrx against system PostgreSQL
run: cargo pgrx init --pg18 /usr/lib/postgresql/18/bin/pg_config
- name: Grant the runner write access to the PG install dirs
# `cargo pgrx test` installs the extension into the system PG's pkglibdir /
# sharedir (root-owned, from apt). The runner must be able to write there,
# otherwise the test-framework install step fails and every #[pg_test]
# cascade-fails on the poisoned test mutex.
run: |
sudo chown -R "$(id -un)" \
"$(/usr/lib/postgresql/18/bin/pg_config --pkglibdir)" \
"$(/usr/lib/postgresql/18/bin/pg_config --sharedir)"
- name: Run tests
run: cargo pgrx test --no-default-features --features pg18