summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2026-06-26 09:54:30 +1200
committerOlly Betts <olly@survex.com>2026-06-26 10:11:11 +1200
commit00e03fe5c68de109eebfc2fb97072c20e86beec9 (patch)
tree7c66c4da059ef364da8b7bd41148bbe2e827d657
parentbf726dbc87cc7d3ba2ef8db3c6457278f467ab3c (diff)
CI: Add sanitisers jobHEADmain
This has significant overlap with the valgrind job in terms of the problems it can catch, but each can detect some problems the other can't.
-rw-r--r--.github/workflows/main.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 6615d8e6..49f21327 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -81,6 +81,42 @@ jobs:
retention-days: 1
if-no-files-found: error
+ # Job with asan+ubsan enabled. Uses GCC - the clang versions of the
+ # sanitisers support some extra things, but I failed to get the build to work
+ # with clang+sanitisers. In case we want to try again in the future, I think
+ # it needs -stdlib=libstdc++ because we used a packaged wxwidgets, which is a
+ # C++ library and built with GCC (and so libstdc++).
+ sanitisers:
+ runs-on: 'ubuntu-24.04'
+ needs: makedist
+ steps:
+ - name: Install CCache
+ uses: hendrikmuhs/ccache-action@v1.2.21
+ with:
+ key: ${{ github.job }}
+ - name: Fetch distribution
+ uses: actions/download-artifact@v8
+ - name: Unpack distribution
+ run: |
+ tar --strip-components=1 -xf survex-*.tar.gz
+ - name: Install package dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install \
+ libwxgtk3.2-dev \
+ libavcodec-dev \
+ libavformat-dev \
+ libgdal-dev \
+ libproj-dev \
+ libswscale-dev
+ - name: configure
+ run: ./configure CC='ccache gcc' CXX='ccache g++' CFLAGS='-g -O2 -Werror -fsanitize=address,undefined,float-divide-by-zero -fsanitize-address-use-after-scope -fsanitize-recover=all -fno-omit-frame-pointer' CXXFLAGS='-g -O2 -Werror -fsanitize=address,undefined,float-divide-by-zero -fsanitize-address-use-after-scope -fsanitize-recover=all -fno-omit-frame-pointer' LIBS=-lm
+ - name: make
+ run: make -j2
+ - name: Run tests
+ run: |
+ make check MSGFMT=: VERBOSE=1
+
valgrind:
runs-on: 'ubuntu-24.04'
needs: makedist