|
| 1 | +# ******************************************************************************* |
| 2 | +# Copyright (c) 2026 Contributors to the Eclipse Foundation |
| 3 | +# |
| 4 | +# See the NOTICE file(s) distributed with this work for additional |
| 5 | +# information regarding copyright ownership. |
| 6 | +# |
| 7 | +# This program and the accompanying materials are made available under the |
| 8 | +# terms of the Apache License Version 2.0 which is available at |
| 9 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# SPDX-License-Identifier: Apache-2.0 |
| 12 | +# ******************************************************************************* |
| 13 | + |
| 14 | +name: Sanitizers |
| 15 | + |
| 16 | +on: |
| 17 | + pull_request: |
| 18 | + types: [opened, reopened, synchronize] |
| 19 | + merge_group: |
| 20 | + types: [checks_requested] |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read |
| 24 | + |
| 25 | +jobs: |
| 26 | + sanitizer-tests: |
| 27 | + name: Bazel Tests (${{ matrix.sanitizer_config }}) |
| 28 | + runs-on: ubuntu-latest |
| 29 | + strategy: |
| 30 | + fail-fast: false |
| 31 | + matrix: |
| 32 | + sanitizer_config: [asan_ubsan_lsan, tsan] |
| 33 | + |
| 34 | + steps: |
| 35 | + - name: Checkout repository |
| 36 | + uses: actions/checkout@v4.2.2 |
| 37 | + with: |
| 38 | + ref: ${{ github.head_ref || github.event.pull_request.head.ref || github.ref }} |
| 39 | + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} |
| 40 | + |
| 41 | + - name: Setup Bazel with shared caching |
| 42 | + uses: bazel-contrib/setup-bazel@0.18.0 |
| 43 | + with: |
| 44 | + bazelisk-version: 1.26.0 |
| 45 | + disk-cache: true |
| 46 | + repository-cache: true |
| 47 | + bazelisk-cache: true |
| 48 | + cache-save: ${{ github.event_name == 'push' }} |
| 49 | + |
| 50 | + - name: Run sanitizer tests via Bazel |
| 51 | + run: | |
| 52 | + set -euo pipefail |
| 53 | + echo "Running: bazel test --config=${{ matrix.sanitizer_config }} //score/... //tests/..." |
| 54 | + bazel test --config=${{ matrix.sanitizer_config }} //score/... //tests/... |
| 55 | +
|
| 56 | + - name: Upload Bazel test logs (always) |
| 57 | + if: always() |
| 58 | + uses: actions/upload-artifact@v6 |
| 59 | + with: |
| 60 | + name: bazel-testlogs-${{ matrix.sanitizer_config }} |
| 61 | + path: bazel-testlogs/**/test.log |
| 62 | + if-no-files-found: warn |
0 commit comments