]> git.sesse.net Git - stockfish/blob - .github/workflows/stockfish_sanitizers.yml
ebfd809c2950f64848417f8a217b56700c887550
[stockfish] / .github / workflows / stockfish_sanitizers.yml
1 name: Stockfish
2 on:
3   workflow_call:
4 jobs:
5   Stockfish:
6     name: ${{ matrix.sanitizers.name }}
7     runs-on: ${{ matrix.config.os }}
8     env:
9       COMPILER: ${{ matrix.config.compiler }}
10       COMP: ${{ matrix.config.comp }}
11       CXXFLAGS: "-Werror"
12     strategy:
13       matrix:
14         config:
15           - name: Ubuntu 20.04 GCC
16             os: ubuntu-20.04
17             compiler: g++
18             comp: gcc
19             shell: bash
20         sanitizers:
21           - name: Run with thread sanitizer
22             make_option: sanitize=thread
23             instrumented_option: sanitizer-thread
24           - name: Run with UB sanitizer
25             make_option: sanitize=undefined
26             instrumented_option: sanitizer-undefined
27           - name: Run under valgrind
28             make_option: ""
29             instrumented_option: valgrind
30           - name: Run under valgrind-thread
31             make_option: ""
32             instrumented_option: valgrind-thread
33     defaults:
34       run:
35         working-directory: src
36         shell: ${{ matrix.config.shell }}
37     steps:
38       - uses: actions/checkout@v3
39         with:
40           fetch-depth: 0
41
42       - name: Download required linux packages
43         run: |
44           sudo apt update
45           sudo apt install expect valgrind g++-multilib
46
47       - name: Download the used network from the fishtest framework
48         run: make net
49
50       - name: Check compiler
51         run: $COMPILER -v
52
53       - name: Test help target
54         run: make help
55
56       - name: Check git
57         run: git --version
58
59       # Sanitizers
60
61       - name: ${{ matrix.sanitizers.name }}
62         run: |
63           export CXXFLAGS="-O1 -fno-inline"
64           make clean
65           make -j2 ARCH=x86-64-modern ${{ matrix.sanitizers.make_option }} debug=yes optimize=no build > /dev/null
66           ../tests/instrumented.sh --${{ matrix.sanitizers.instrumented_option }}