From 4fdb22562a8404112a0ad0a2d4db913c0f37fab0 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Fri, 14 Aug 2026 12:32:43 +0100 Subject: [PATCH 1/3] Faster build and test workflow --- .github/workflows/on-pr.yml | 112 ++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 63 deletions(-) diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index 5e9b1f6ea..640b9fa0b 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -28,45 +28,70 @@ jobs: contents: read uses: eclipse-score/cicd-workflows/.github/workflows/on-pr.yml@on-pr/v0.0.0 + # We don't use eclipse-score/cicd-workflows/.github/workflows/tests.yml + # because it is more resource efficient to build and test in the same job. + # Also the cache name in the template is not configurable. build: - name: Build ${{ matrix.bazel-config }} + name: Build and test ${{ matrix.name }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - bazel-config: [x86_64-linux, arm64-linux] + include: + - name: x86_64-linux + bazel-args: --config=x86_64-linux + build: true + test: true + - name: arm64-linux + bazel-args: --config=arm64-linux + build: true + test: false # Cannot run on x86_64 + - name: asan_ubsan_lsan + bazel-args: --config=x86_64-linux --config=asan_ubsan_lsan + build: false # https://github.com/eclipse-score/lifecycle/issues/476 + test: true + - name: tsan + bazel-args: --config=x86_64-linux --config=tsan + build: false # https://github.com/eclipse-score/lifecycle/issues/474 + test: true permissions: contents: read steps: - name: Checkout code uses: actions/checkout@v7 - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.19.0 + - name: Setup Bazel with shared caching + uses: eclipse-score/cicd-actions/setup-bazel-cache@212bbf86267e9381da9d2daf962d12f6feafbc90 with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }}-${{ matrix.bazel-config }} - repository-cache: true - cache-save: ${{ github.event_name == 'push' }} + unique-cache-name: ${{ github.workflow }}-${{ github.job }}-${{ matrix.name }} - name: Build with Bazel + if: matrix.build run: | - bazel build --lockfile_mode=error --config ${{ matrix.bazel-config }} //score/... //examples/... - - test: - name: Test ${{ matrix.bazel-config }} - strategy: - fail-fast: false - matrix: - bazel-config: [x86_64-linux, arm64-linux] - # TODO: GitHub provides ARM servers but the workflow template does not allow to use them. - exclude: - - bazel-config: arm64-linux - uses: eclipse-score/cicd-workflows/.github/workflows/tests.yml@93aac16ada7d247bbb6ae926509ddea74cf5213a # v0.0.2 - permissions: - contents: read - with: - bazel-target: 'test --lockfile_mode=error //score/... //tests/... //scripts/... --config=${{ matrix.bazel-config }}' + bazel build \ + --lockfile_mode=error \ + ${{ matrix.bazel-args }} \ + //examples/... \ + //score/... + + - name: Test with Bazel + if: matrix.test + run: | + bazel test \ + --lockfile_mode=error \ + ${{ matrix.bazel-args }} \ + //examples/... \ + //score/... \ + //scripts/... \ + //tests/... + + - name: Upload test logs + if: always() + uses: actions/upload-artifact@v7 + with: + name: bazel-testlogs-${{ matrix.name }}-${{ github.run_id }} + path: bazel-testlogs/ + retention-days: 7 reference-integration: name: Reference integration @@ -79,43 +104,6 @@ jobs: module_name: 'score_lifecycle_health' target_branch: 'main' - sanitizers: - name: ${{ matrix.name }} - runs-on: ubuntu-latest - permissions: - contents: read - strategy: - fail-fast: false - matrix: - include: - - name: ASAN + UBSAN + LSAN - bazel-config: asan_ubsan_lsan - - name: TSAN - bazel-config: tsan - steps: - - name: Checkout code - uses: actions/checkout@v7 - - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.19.0 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }}-${{ matrix.bazel-config }} - repository-cache: true - cache-save: ${{ github.event_name == 'push' }} - - - name: Run tests with sanitizers - run: | - bazel test --lockfile_mode=error --config=${{ matrix.bazel-config }} --config=x86_64-linux //score/... //tests/... --verbose_failures - - - name: Upload test logs on failure - if: failure() - uses: actions/upload-artifact@v7 - with: - name: bazel-testlogs-${{ matrix.bazel-config }}-${{ github.run_id }} - path: bazel-testlogs/ - retention-days: 7 - clippy: name: Clippy runs-on: ubuntu-latest @@ -212,9 +200,7 @@ jobs: needs: - common - build - - test - reference-integration - - sanitizers - clippy - cpp-coverage - rust-coverage From a9553050ce7b5c0a14a8bf038eaeff9d6cfeaa18 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Fri, 14 Aug 2026 12:44:16 +0100 Subject: [PATCH 2/3] Disable demo verification under TSAN As with all other Rust tests. --- examples/demo_verification/BUILD | 1 + tests/utils/bazel/integration.bzl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/demo_verification/BUILD b/examples/demo_verification/BUILD index cbca3b511..8cbc94902 100644 --- a/examples/demo_verification/BUILD +++ b/examples/demo_verification/BUILD @@ -30,4 +30,5 @@ integration_test( "hm_logging.json", "logging.json", ], + tags = ["no-tsan"], ) diff --git a/tests/utils/bazel/integration.bzl b/tests/utils/bazel/integration.bzl index f9b2b7ee7..11357acca 100644 --- a/tests/utils/bazel/integration.bzl +++ b/tests/utils/bazel/integration.bzl @@ -115,7 +115,7 @@ def integration_test( py_itf_test( name = name, srcs = srcs, - tags = [ + tags = kwargs.pop("tags", []) + [ "integration", "no-asan", # The test container does not ship the sanitizer runtime; daemon fails to start. ], @@ -134,7 +134,7 @@ def integration_test( py_itf_test( name = "{}_qemu".format(name), srcs = srcs, - tags = [ + tags = kwargs.pop("tags", []) + [ "exclusive", # The QEMU plugin uses a hardcoded port so we can only run one test at a time. "integration", "no-asan", # The test container does not ship the sanitizer runtime; daemon fails to start. From 1c6fc2178e3077fb7e44a558453abe0804c3d2c9 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Fri, 14 Aug 2026 14:07:46 +0100 Subject: [PATCH 3/3] Remove special case TSAN tests There is a build flag to run all tests with TSAN now, so these are not needed. --- .../src/daemon/src/common/concurrency/BUILD | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/score/launch_manager/src/daemon/src/common/concurrency/BUILD b/score/launch_manager/src/daemon/src/common/concurrency/BUILD index 859eafdf6..30735211c 100644 --- a/score/launch_manager/src/daemon/src/common/concurrency/BUILD +++ b/score/launch_manager/src/daemon/src/common/concurrency/BUILD @@ -108,27 +108,6 @@ lm_cc_test( ], ) -lm_cc_test( - name = "mpsc_bounded_queue_tsan_test", - srcs = ["mpsc_bounded_queue_test.cpp"], - copts = [ - "-fsanitize=thread", - "-O0", - "-g", - ], - linkopts = ["-fsanitize=thread"], - tags = [ - "no-asan", - "no-coverage", - "tsan", - ], - target_compatible_with = ["@platforms//os:linux"], - deps = [ - ":mpsc_bounded_queue", - "@googletest//:gtest_main", - ], -) - lm_cc_test( name = "mpmc_concurrent_queue_test", srcs = ["mpmc_concurrent_queue_test.cpp"], @@ -152,24 +131,3 @@ lm_cc_test( "@googletest//:gtest_main", ], ) - -lm_cc_test( - name = "mpmc_concurrent_queue_tsan_test", - srcs = ["mpmc_concurrent_queue_test.cpp"], - copts = [ - "-fsanitize=thread", - "-O0", - "-g", - ], - linkopts = ["-fsanitize=thread"], - tags = [ - "no-asan", - "no-coverage", - "tsan", - ], - target_compatible_with = ["@platforms//os:linux"], - deps = [ - ":mpmc_concurrent_queue", - "@googletest//:gtest_main", - ], -)