Debian Codegraph @

.github/workflows/sanitizer.yml

raw symbols SCIP
1 name: Run sanitizer checks
2
3 on:
4 workflow_dispatch:
5 push:
6 branches: [ master ]
7 paths:
8 - '**.h'
9 - '**.c'
10
11 pull_request:
12 branches: [ master ]
13 paths:
14 - '**.h'
15 - '**.c'
16
17 permissions: # added using https://github.com/step-security/secure-workflows
18 contents: read
19
20 jobs:
21 build:
22 runs-on: ubuntu-latest
23 name: Build with ${{ matrix.sanitizer }} sanitizer for ${{ matrix.ucs }}
24 strategy:
25 matrix:
26 ucs: [ucs2, ucs4]
27 sanitizer: [address, leak, undefined]
28 include:
29 - sanitizer: "address"
30 options: "ASAN_OPTIONS=detect_leaks=0"
31 - sanitizer: "leak"
32 options: "LSAN_OPTIONS=fast_unwind_on_malloc=0"
33 - sanitizer: "undefined"
34 options: "UBSAN_OPTIONS=halt_on_error=1"
35 steps:
36 - name: Harden Runner
37 uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
38 with:
39 egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
40
41 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
42 - name: Install dependencies
43 run: sudo apt-get update -qq && sudo apt-get install -y libyaml-dev
44 - name: Autogen
45 run: ./autogen.sh
46 - name: Configure
47 run: CFLAGS="-fsanitize=${{ matrix.sanitizer }} -g" ./configure
48 if: matrix.ucs == 'ucs2'
49 - name: Configure with ucs4
50 run: CFLAGS="-fsanitize=${{ matrix.sanitizer }} -g" ./configure --enable-ucs4
51 if: matrix.ucs == 'ucs4'
52 - name: Make check
53 run: ${{ matrix.options }} make check
54 - name: Store the test suite log
55 if: ${{ always() }} # store the test suite log even if the tests failed
56 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
57 with:
58 name: test-suite-${{ matrix.ucs }}-${{ matrix.sanitizer }}.log
59 path: tests/test-suite.log