Skip to content

Commit eed6948

Browse files
committed
add pg18 to ci
1 parent 56d717d commit eed6948

File tree

3 files changed

+36
-20
lines changed

3 files changed

+36
-20
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,31 @@ RUN apt-get update && apt-get -y install build-essential libreadline-dev zlib1g-
1010
flex bison libxml2-dev libxslt-dev libssl-dev \
1111
libxml2-utils xsltproc ccache pkg-config wget \
1212
curl lsb-release ca-certificates gnupg sudo git \
13-
nano net-tools awscli
13+
nano net-tools awscli libkrb5-dev
1414

1515
# install azure-cli
1616
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null
1717
RUN echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ `lsb_release -cs` main" | tee /etc/apt/sources.list.d/azure-cli.list
1818
RUN apt-get update && apt-get install -y azure-cli
1919

2020
# install Postgres
21-
RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
21+
RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
22+
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg 18" >> /etc/apt/sources.list.d/pgdg.list'
2223
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
2324
RUN apt-get update && apt-get -y install postgresql-${PG_MAJOR}-postgis-3 \
2425
postgresql-server-dev-${PG_MAJOR} \
2526
postgresql-client-${PG_MAJOR} \
2627
libpq-dev
2728

29+
# install pgaudit extension
30+
RUN git clone --branch integration https://github.com/pgaudit/pgaudit.git /tmp/pgaudit && \
31+
cd /tmp/pgaudit && make install USE_PGXS=1 PG_CONFIG=pg_config
32+
2833
# set up permissions so that rust user can create extensions
2934
RUN chmod a+rwx `pg_config --pkglibdir` \
3035
`pg_config --sharedir`/extension \
3136
/var/run/postgresql/
3237

33-
# install pgaudit
34-
RUN apt-get update && apt-get -y install postgresql-${PG_MAJOR}-pgaudit
35-
3638
# initdb requires non-root user. This will also be the user that runs the container.
3739
ARG USERNAME=rust
3840
ARG USER_UID=1000

.github/workflows/ci.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
build-and-test:
2020
strategy:
2121
matrix:
22-
postgres: [ 14, 15, 16, 17 ]
22+
postgres: [ 14, 15, 16, 17, 18 ]
2323
runs_on: [ 'ubuntu-22.04', 'ubuntu-22.04-arm' ]
2424
include:
2525
- runs_on: ubuntu-22.04
@@ -91,24 +91,21 @@ jobs:
9191
curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
9292
pipenv install --dev
9393
94-
- name: Install PostgreSQL
94+
- name: Install PostgreSQL and postgis
9595
run: |
9696
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
97+
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg 18" >> /etc/apt/sources.list.d/pgdg.list'
9798
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
9899
sudo apt-get update
99100
sudo apt-get -y install build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev \
100101
libxslt-dev libssl-dev libxml2-utils xsltproc ccache pkg-config \
101-
gnupg ca-certificates
102-
sudo apt-get -y install postgresql-${{ env.PG_MAJOR }}-postgis-3 \
102+
gnupg ca-certificates libkrb5-dev
103+
sudo apt-get -y install postgresql-${{ env.PG_MAJOR }}-postgis-3 \
103104
postgresql-server-dev-${{ env.PG_MAJOR }} \
104-
postgresql-client-${{ env.PG_MAJOR }} \
105+
postgresql-client-${{ env.PG_MAJOR }} \
105106
libpq-dev
106107
echo "export PG_MAJOR=${{ env.PG_MAJOR }}" >> $GITHUB_ENV
107108
108-
- name: Install pgaudit extension
109-
run: |
110-
sudo apt-get install -y postgresql-${{ env.PG_MAJOR }}-pgaudit
111-
112109
- name: Install azure-cli
113110
run: |
114111
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
@@ -124,27 +121,44 @@ jobs:
124121

125122
- name: Set up permissions for PostgreSQL
126123
run: |
127-
sudo chmod a+rwx $(/usr/lib/postgresql/${{ env.PG_MAJOR }}/bin/pg_config --pkglibdir) \
128-
$(/usr/lib/postgresql/${{ env.PG_MAJOR }}/bin/pg_config --sharedir)/extension \
124+
sudo chmod a+rwx $(${{ env.PG_CONFIG }} --pkglibdir) \
125+
$(${{ env.PG_CONFIG }} --sharedir)/extension \
129126
/var/run/postgresql/
130127
128+
- uses: actions/checkout@v4
129+
if: ${{ env.PG_MAJOR == '18' }}
130+
with:
131+
repository: 'pgaudit/pgaudit'
132+
ref: 'integration'
133+
path: pgaudit
134+
135+
- name: Install pgaudit extension for pg18
136+
if: ${{ env.PG_MAJOR == '18' }}
137+
run: |
138+
cd pgaudit && make install USE_PGXS=1 PG_CONFIG=${{ env.PG_CONFIG }}
139+
140+
- name: Install pgaudit extension for < pg18
141+
if: ${{ env.PG_MAJOR != '18' }}
142+
run: |
143+
sudo apt-get -y install postgresql-${{ env.PG_MAJOR }}-pgaudit
144+
131145
- name: Check format and lint
132146
run: |
133147
make check-format
134148
make check-lint
135149
136150
- name: Run tests without coverage
137-
if: ${{ env.PG_MAJOR != '17' || matrix.arch != 'x86_64' }}
151+
if: ${{ env.PG_MAJOR != '18' || matrix.arch != 'x86_64' }}
138152
run: |
139153
make check
140154
141155
- name: Run tests with coverage
142-
if: ${{ env.PG_MAJOR == '17' && matrix.arch == 'x86_64' }}
156+
if: ${{ env.PG_MAJOR == '18' && matrix.arch == 'x86_64' }}
143157
run: |
144158
make check-with-coverage
145159
146160
- name: Upload coverage report to Codecov
147-
if: ${{ env.PG_MAJOR == '17' && matrix.arch == 'x86_64' }}
161+
if: ${{ env.PG_MAJOR == '18' && matrix.arch == 'x86_64' }}
148162
uses: codecov/codecov-action@v4
149163
with:
150164
fail_ci_if_error: true

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name = "pgrx_embed_pg_parquet"
1212
path = "./src/bin/pgrx_embed.rs"
1313

1414
[features]
15-
default = ["pg17"]
15+
default = ["pg18"]
1616
pg18 = ["pgrx/pg18", "pgrx-tests/pg18"]
1717
pg17 = ["pgrx/pg17", "pgrx-tests/pg17"]
1818
pg16 = ["pgrx/pg16", "pgrx-tests/pg16"]

0 commit comments

Comments
 (0)