Skip to content

Commit 0a57d12

Browse files
committed
PG-1465 Add CI workfolw with sanitizers
1 parent fd91411 commit 0a57d12

File tree

2 files changed

+73
-4
lines changed

2 files changed

+73
-4
lines changed

.github/workflows/sanitizers.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Sanitizers
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- TDE_REL_17_STABLE
7+
8+
env:
9+
CC: clang
10+
LD: clang
11+
UBSAN_OPTIONS: log_path=./sanitizers/ubsan.log print_stacktrace=1 print_summary=1 halt_on_error=1
12+
## ASAN_OPTIONS:
13+
14+
jobs:
15+
run:
16+
name: Run
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- name: Clone repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: Install dependencies
25+
run: ci_scripts/ubuntu-deps.sh
26+
27+
- name: Build postgres
28+
run: ci_scripts/make-build.sh sanitize
29+
30+
- name: Setup kmip and vault
31+
run: ci_scripts/setup-keyring-servers.sh
32+
33+
- name: Run tests
34+
run: ci_scripts/make-test.sh
35+
36+
- name: Report on test fail
37+
uses: actions/upload-artifact@v4
38+
if: ${{ failure() }}
39+
with:
40+
name: log-test-${{ inputs.os }}-${{ inputs.build_script }}-${{ inputs.build_type }}
41+
path: |
42+
src/build/testrun/
43+
src/contrib/*/log
44+
src/contrib/*/regression.diffs
45+
src/contrib/*/regression.out
46+
src/contrib/*/results
47+
src/contrib/*/tmp_check
48+
src/contrib/*/t/results
49+
src/src/test/*/log
50+
src/src/test/*/regression.diffs
51+
src/src/test/*/regression.out
52+
src/src/test/*/results
53+
src/src/test/*/tmp_check
54+
retention-days: 3

ci_scripts/make-build.sh

+19-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@ source "$SCRIPT_DIR/env.sh"
1717

1818
cd "$SCRIPT_DIR/.."
1919

20-
if [ "$1" = "debugoptimized" ]; then
21-
export CFLAGS="-O2"
22-
export CXXFLAGS="-O2"
23-
fi
20+
case "$1" in
21+
debug)
22+
# Nothing to do here
23+
echo "Building with debug option"
24+
;;
25+
debugoptimized)
26+
echo "Building with debugoptimized option"
27+
export CFLAGS="-O2"
28+
;;
29+
30+
sanitize)
31+
echo "Building with sanitize option"
32+
export CFLAGS="-fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-inline-functions"
33+
;;
34+
*)
35+
echo "Unknown build type: $1"
36+
exit 1
37+
;;
38+
esac
2439

2540
./configure --prefix="$INSTALL_DIR" --enable-debug --enable-cassert --enable-tap-tests $ENABLE_COVERAGE
2641
make install-world -j

0 commit comments

Comments
 (0)