Skip to content

Commit 25e40a5

Browse files
committed
Run CI actions for PGSM with assertions enabled
While the sanitizer checks were ran with assertions enabled I do not think that is enough. We want to test with assertions enabled on all versions of PostgreSQL that we support. To save some CPU cycles now that we will build much more we only build with gcc against packages on Linux. Also disable building with injection points for now until we have some test case which actually uses them since PostgreSQL version before 17 did not support them.
1 parent a6eb046 commit 25e40a5

3 files changed

Lines changed: 55 additions & 18 deletions

File tree

.github/scripts/build-postgres.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ PSP_DIR=$SCRIPT_DIR/../../../postgres
1010
case "$1" in
1111
debug)
1212
echo "Building with debug option"
13-
ARGS+=" --enable-cassert --enable-injection-points"
13+
ARGS+=" --enable-cassert"
1414
;;
1515

1616
debugoptimized)
1717
echo "Building with debugoptimized option"
1818
export CFLAGS="-O2"
19-
ARGS+=" --enable-cassert --enable-injection-points"
19+
ARGS+=" --enable-cassert"
2020
;;
2121

2222
coverage)
2323
echo "Building with coverage option"
24-
ARGS+=" --enable-cassert --enable-injection-points --enable-coverage"
24+
ARGS+=" --enable-cassert --enable-coverage"
2525
;;
2626

2727
sanitize)

.github/workflows/build-and-test.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,45 +38,63 @@ jobs:
3838
- name: Clone repository
3939
uses: actions/checkout@v7
4040
with:
41+
path: src
4142
submodules: recursive
4243
ref: ${{ github.ref }}
4344

4445
- name: Install dependencies for Ubuntu
4546
if: startsWith(inputs.os, 'ubuntu-')
46-
run: .github/scripts/ubuntu-deps.sh
47+
run: src/.github/scripts/ubuntu-deps.sh
48+
49+
- name: Install dev dependencies for Ubuntu
50+
if: startsWith(inputs.os, 'ubuntu-') && env.PG_PACKAGE == 'source'
51+
run: src/.github/scripts/ubuntu-deps.sh dev
4752

4853
- name: Install dependencies for MacOS
4954
if: startsWith(inputs.os, 'macos-')
50-
run: .github/scripts/macos-deps.sh
55+
run: src/.github/scripts/macos-deps.sh
5156

5257
- name: Install PostgreSQL
53-
run: .github/scripts/install-postgresql.sh ${{ env.PG_PACKAGE }} ${{ env.PG_VERSION }}
58+
if: env.PG_PACKAGE != 'source'
59+
run: src/.github/scripts/install-postgresql.sh ${{ env.PG_PACKAGE }} ${{ env.PG_VERSION }}
60+
61+
- name: Clone postgres repository
62+
if: env.PG_PACKAGE == 'source'
63+
uses: actions/checkout@v7
64+
with:
65+
path: postgres
66+
repository: percona/postgres.git
67+
ref: REL_${{ env.PG_VERSION }}_STABLE
68+
69+
- name: Build PostgreSQL
70+
if: env.PG_PACKAGE == 'source'
71+
run: src/.github/scripts/build-postgres.sh ${{ env.BUILD_TYPE }}
5472

5573
- name: Build pg_stat_monitor
56-
run: .github/scripts/build.sh ${{ env.BUILD_TYPE }}
74+
run: src/.github/scripts/build.sh ${{ env.BUILD_TYPE }}
5775

5876
- name: Set permissions
59-
if: startsWith(inputs.os, 'ubuntu-')
77+
if: startsWith(inputs.os, 'ubuntu-') && env.PG_PACKAGE != 'source'
6078
run: sudo chown -R runner:runner /var/run/postgresql
6179

6280
- name: Stop existing PostgreSQL instances
63-
if: startsWith(inputs.os, 'ubuntu-')
81+
if: startsWith(inputs.os, 'ubuntu-') && env.PG_PACKAGE != 'source'
6482
run: sudo service postgresql stop
6583

6684
- name: Run tests
67-
run: .github/scripts/test.sh ${{ env.BUILD_TYPE }}
85+
run: src/.github/scripts/test.sh ${{ env.BUILD_TYPE }}
6886

6987
- name: Report on test fail
7088
uses: actions/upload-artifact@v4
7189
if: ${{ failure() }}
7290
with:
7391
name: log-test-${{ env.PG_PACKAGE }}-${{ env.PG_VERSION }}-${{ env.OS }}-${{ env.CC }}-${{ env.BUILD_TYPE }}
7492
path: |
75-
regression_install
76-
regression_install.log
77-
regression.diffs
78-
regression.out
79-
results
80-
t/results
81-
tmp_check
93+
src/regression_install
94+
src/regression_install.log
95+
src/regression.diffs
96+
src/regression.out
97+
src/results
98+
src/t/results
99+
src/tmp_check
82100
retention-days: 3

.github/workflows/matrix.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
pg_package: [psp]
2020
pg_version: [14, 15, 16, 17, 18]
2121
os: [ubuntu-24.04]
22-
compiler: [gcc, clang]
22+
compiler: [gcc]
2323
build_type: [debugoptimized]
2424
uses: ./.github/workflows/build-and-test.yml
2525
with:
@@ -38,6 +38,25 @@ jobs:
3838
pg_package: [pgdg]
3939
pg_version: [14, 15, 16, 17, 18]
4040
os: [ubuntu-24.04]
41+
compiler: [gcc]
42+
build_type: [debugoptimized]
43+
uses: ./.github/workflows/build-and-test.yml
44+
with:
45+
pg_package: ${{ matrix.pg_package }}
46+
pg_version: ${{ matrix.pg_version }}
47+
os: ${{ matrix.os }}
48+
compiler: ${{ matrix.compiler }}
49+
build_type: ${{ matrix.build_type }}
50+
secrets: inherit
51+
52+
source:
53+
name: From source
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
pg_package: [source]
58+
pg_version: [14, 15, 16, 17, 18]
59+
os: [ubuntu-24.04]
4160
compiler: [gcc, clang]
4261
build_type: [debugoptimized]
4362
uses: ./.github/workflows/build-and-test.yml

0 commit comments

Comments
 (0)