-
Notifications
You must be signed in to change notification settings - Fork 16
52 lines (48 loc) · 1.61 KB
/
sanitizer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Run sanitizer checks
on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- '**.h'
- '**.c'
pull_request:
branches: [ master ]
env:
LIBLOUIS_VERSION: 3.31.0
jobs:
sanitizer:
runs-on: ubuntu-latest
name: Build with ${{ matrix.sanitizer }} sanitizer
strategy:
matrix:
sanitizer: [address, undefined]
include:
- sanitizer: "address"
options: "ASAN_OPTIONS=detect_leaks=0"
- sanitizer: "leak"
options: "LSAN_OPTIONS=fast_unwind_on_malloc=0"
- sanitizer: "undefined"
options: "UBSAN_OPTIONS=halt_on_error=1"
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y texinfo libxml2-dev libxml2 openjdk-8-jdk
- name: Fetch and build liblouis
run: |
wget https://github.com/liblouis/liblouis/releases/download/v${LIBLOUIS_VERSION}/liblouis-${LIBLOUIS_VERSION}.tar.gz
tar -xf liblouis-*.tar.gz
( cd liblouis-${LIBLOUIS_VERSION} && ./configure && make && sudo make install )
sudo ldconfig
- name: Autogen
run: ./autogen.sh
- name: Configure
run: CFLAGS="-fsanitize=${{ matrix.sanitizer }} -g" ./configure
- name: Make check
run: ${{ matrix.options }} make check
- name: Store the test suite log
if: ${{ always() }} # store the test suite log even if the tests failed
uses: actions/upload-artifact@v3
with:
name: test-suite-${{ matrix.sanitizer }}.log
path: tests/test-suite.log