|
1 |
| -name: Sanitize with AddressSanitizer, MemorySanitizer, ThreadSanitizer and UndefinedBehaviorSanitizer. |
| 1 | +name: Sanitize |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | pull_request_review:
|
5 | 5 | types: [submitted]
|
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - main |
6 | 9 |
|
7 | 10 | concurrency:
|
8 | 11 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
9 | 12 | cancel-in-progress: true
|
10 | 13 |
|
11 | 14 | jobs:
|
12 |
| - build_dependencies: |
13 |
| - name: Build deps [ubuntu] |
14 |
| - runs-on: ubuntu-latest |
15 |
| - if: github.event.review.state == 'APPROVED' |
| 15 | + get_dependencies: |
| 16 | + name: "Dependencies" |
| 17 | + uses: ./.github/workflows/dependencies.yaml |
| 18 | + |
| 19 | + build_and_run_sanitizer: |
| 20 | + name: ${{ matrix.mode }} |
| 21 | + needs: get_dependencies |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + mode: ["asan", "msan", "tsan", "ubsan"] |
| 25 | + fail-fast: false |
| 26 | + runs-on: ubuntu-22.04 |
16 | 27 | steps:
|
17 | 28 | - uses: actions/checkout@v4
|
18 |
| - - name: Get dependencies hash |
19 |
| - id: get-hash |
20 |
| - run: echo "deps_hash=`cat docker/build_deps.sh | shasum`" >> $GITHUB_OUTPUT |
21 |
| - - name: Cache lookup |
22 |
| - uses: actions/cache/restore@v4 |
23 |
| - id: cache-lookup |
24 |
| - with: |
25 |
| - path: deps |
26 |
| - key: deps-${{ steps.get-hash.outputs.deps_hash }} |
27 |
| - lookup-only: true |
28 |
| - - name: Set up dependencies |
29 |
| - if: steps.cache-lookup.outputs.cache-hit != 'true' |
30 |
| - run: | |
31 |
| - sudo apt-get update |
32 |
| - sudo apt-get install -qy build-essential \ |
33 |
| - gdb \ |
34 |
| - curl \ |
35 |
| - python3.10 \ |
36 |
| - python3-pip \ |
37 |
| - cmake \ |
38 |
| - ninja-build \ |
39 |
| - pkg-config \ |
40 |
| - bison \ |
41 |
| - libfl-dev \ |
42 |
| - libbenchmark-dev \ |
43 |
| - libgmock-dev \ |
44 |
| - libz-dev |
45 |
| - - name: Fetch & Build non packaged dependencies |
46 |
| - if: steps.cache-lookup.outputs.cache-hit != 'true' |
47 |
| - run: | |
48 |
| - mkdir -p deps |
49 |
| - cd deps |
50 |
| - ../docker/build_deps.sh |
51 |
| - - name: Cache save |
52 |
| - if: steps.cache-lookup.outputs.cache-hit != 'true' |
53 |
| - uses: actions/cache/save@v4 |
| 29 | + - uses: actions/cache/restore@v4 |
54 | 30 | with:
|
55 | 31 | path: deps
|
56 |
| - key: deps-${{ steps.get-hash.outputs.deps_hash }} |
57 |
| - |
58 |
| - run_asan: |
59 |
| - needs: build_dependencies |
60 |
| - uses: ./.github/workflows/sanitizer-check.yaml |
61 |
| - with: |
62 |
| - sanitizer-name: 'asan' |
63 |
| - |
64 |
| - run_msan: |
65 |
| - needs: build_dependencies |
66 |
| - uses: ./.github/workflows/sanitizer-check.yaml |
67 |
| - with: |
68 |
| - sanitizer-name: 'msan' |
69 |
| - |
70 |
| - run_tsan: |
71 |
| - needs: build_dependencies |
72 |
| - uses: ./.github/workflows/sanitizer-check.yaml |
73 |
| - with: |
74 |
| - sanitizer-name: 'tsan' |
75 |
| - |
76 |
| - run_ubsan: |
77 |
| - needs: build_dependencies |
78 |
| - uses: ./.github/workflows/sanitizer-check.yaml |
79 |
| - with: |
80 |
| - sanitizer-name: 'ubsan' |
| 32 | + key: ${{ needs.get_dependencies.outputs.cache_key }} |
| 33 | + - name: Build [${{ matrix.mode }}] |
| 34 | + run: ${{ github.workspace }}/.github/workflows/sanitizers/build_sanitizer.sh ${{ matrix.mode }} |
| 35 | + - name: UT [c++,${{ matrix.mode }}] |
| 36 | + run: ${{ github.workspace }}/cmake.bld/Linux/run-unittests.sh |
0 commit comments