From 1c8e0284771b29f059b8839624633f4724340101 Mon Sep 17 00:00:00 2001 From: Alexander Cohen Date: Sat, 27 Dec 2025 16:33:03 -0500 Subject: [PATCH 1/2] Add GitHub workflow for sanitizer tests Run tests with thread, address, and undefined behavior sanitizers in parallel on PRs to catch data races, memory issues, and UB. --- .github/workflows/sanitizers.yml | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/sanitizers.yml diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml new file mode 100644 index 0000000..c9f4f62 --- /dev/null +++ b/.github/workflows/sanitizers.yml @@ -0,0 +1,35 @@ +name: Sanitizers + +on: + workflow_call: {} + workflow_dispatch: {} + pull_request: {} + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + sanitizer: + name: ${{ matrix.sanitizer }} + runs-on: macos-latest + + strategy: + fail-fast: false + matrix: + sanitizer: [thread, address, undefined] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Swift + uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.0" + + - name: Run tests with ${{ matrix.sanitizer }} sanitizer + run: swift test --sanitize ${{ matrix.sanitizer }} From 0e5f36e7b786c6849ccb7c14aafea186a99a7202 Mon Sep 17 00:00:00 2001 From: Alexander Cohen Date: Sat, 27 Dec 2025 16:45:58 -0500 Subject: [PATCH 2/2] Update sanitizers.yml --- .github/workflows/sanitizers.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index c9f4f62..f2adf9e 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -25,11 +25,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - - name: Set up Swift - uses: swift-actions/setup-swift@v2 + + - name: Use Latest Stable Xcode + uses: maxim-lobanov/setup-xcode@v1 with: - swift-version: "6.0" + xcode-version: latest-stable - name: Run tests with ${{ matrix.sanitizer }} sanitizer run: swift test --sanitize ${{ matrix.sanitizer }}