mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
This sets the workflow concurrency to 1 for all workflows. For PRs this means if you push an additional commit older jobs will be cancelled. The documentation workflow already only runs on tags or merges to main. For this, we cancel previous runs if they are to the same destination (tag or main) but still prevent 2 jobs from running at once if they are spawned from different refs.
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
name: Sanitizers
|
|
|
|
on: [pull_request, push]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: asan
|
|
cmake-flags: "-DCMAKE_BUILD_TYPE=Asan"
|
|
ctest-env: ""
|
|
ctest-flags: "-E 'wpiutil|ntcore|wpilibc'"
|
|
- name: tsan
|
|
cmake-flags: "-DCMAKE_BUILD_TYPE=Tsan"
|
|
ctest-env: "TSAN_OPTIONS=second_deadlock_stack=1"
|
|
ctest-flags: "-E 'ntcore|cscore|cameraserver|wpilibc|wpilibNewCommands'"
|
|
- name: ubsan
|
|
cmake-flags: "-DCMAKE_BUILD_TYPE=Ubsan"
|
|
ctest-env: ""
|
|
ctest-flags: ""
|
|
name: "${{ matrix.name }}"
|
|
runs-on: ubuntu-latest
|
|
container: wpilib/roborio-cross-ubuntu:2022-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install Dependencies
|
|
run: |
|
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
|
sudo apt install -y gcc-11 g++-11
|
|
sudo update-alternatives \
|
|
--install /usr/bin/gcc gcc /usr/bin/gcc-11 11 \
|
|
--slave /usr/bin/g++ g++ /usr/bin/g++-11
|
|
sudo update-alternatives --set gcc /usr/bin/gcc-11
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install jinja
|
|
run: python -m pip install jinja2
|
|
- name: configure
|
|
run: mkdir build && cd build && cmake ${{ matrix.cmake-flags }} ..
|
|
- name: build
|
|
working-directory: build
|
|
run: cmake --build . -j$(nproc)
|
|
- name: test
|
|
working-directory: build
|
|
run: ${{ matrix.ctest-env }} ctest --output-on-failure ${{ matrix.ctest-flags }}
|