From ee8e8ad8247edfa06db652da840ddafec1c02d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20J=C3=BCnger?= Date: Thu, 17 Oct 2024 16:40:31 +0200 Subject: [PATCH] add tsan CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Jünger --- .github/workflows/tsan.yml | 59 ++++++++++++++++++++++++++++++++++++++ docker/entrypoint.sh | 9 +++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tsan.yml diff --git a/.github/workflows/tsan.yml b/.github/workflows/tsan.yml new file mode 100644 index 000000000..38d314d93 --- /dev/null +++ b/.github/workflows/tsan.yml @@ -0,0 +1,59 @@ +name: tsan + +on: + push: + pull_request: + +jobs: + ubuntu: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: [20.04, 22.04] + platform: [linux/amd64, linux/arm64] + target: [clang-shared-regression-tsan] + steps: + - name: Install qemu-user-static + run: | + if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then + sudo apt-get update && sudo apt-get install -y qemu-user-static + fi + - name: Checkout + uses: actions/checkout@v4 + - name: Build + run: | + docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg UBUNTU_VERSION=${{ matrix.version }} -f docker/ubuntu.dockerfile . + docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test + almalinux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: [8, 9] + platform: [linux/amd64, linux/arm64] + target: [clang-shared-regression-tsan] + steps: + - name: Install qemu-user-static + run: | + if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then + sudo apt-get update && sudo apt-get install -y qemu-user-static + fi + - name: Checkout + uses: actions/checkout@v4 + - name: Build + run: | + docker buildx build --platform ${{ matrix.platform }} -t systemc_test --build-arg ALMA_VERSION=${{ matrix.version }} -f docker/alma.dockerfile . + docker run -e SYSTEMC_CI_TARGET=${{ matrix.target }} systemc_test + macos: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + target: [clang-shared-regression-tsan] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build + run: | + SYSTEMC_CI_TARGET=${{ matrix.target }} SYSTEMC_SRC_PATH=$PWD docker/entrypoint.sh diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b32a77af7..57207e476 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -62,7 +62,14 @@ case "$SYSTEMC_CI_TARGET" in BUILD_REGRESSIONS=true CXX_FLAGS="$CXX_FLAGS -fsanitize=undefined" ;; - *) + clang-shared-regression-tsan) + CC=clang + CXX=clang++ + BUILD_SHARED_LIBRARY=true + BUILD_REGRESSIONS=true + CXX_FLAGS="$CXX_FLAGS -fsanitize=thread" + ;; + *) echo "Error: Unknown SYSTEMC_CI_TARGET '$SYSTEMC_CI_TARGET'" exit 1 ;;