From c27f7e1735df7b36df4966b61cfa74729d380e69 Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Mon, 15 Dec 2025 17:01:06 +0100 Subject: [PATCH 01/12] Introduce QNX CI job --- .bazelrc | 2 +- .github/workflows/build_and_test_qnx.yml | 61 ++++++++++++++++++++++++ MODULE.bazel | 4 +- 3 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build_and_test_qnx.yml diff --git a/.bazelrc b/.bazelrc index 89149e564..2342b0d96 100644 --- a/.bazelrc +++ b/.bazelrc @@ -29,7 +29,7 @@ build --experimental_retain_test_configuration_across_testonly #https://github.c # * The credentials for this account stored in your ~/.netrc (machine qnx.com) # * A license stored under `/opt/score_qnx/license/licenses` common:qnx_x86_64 --host_platform=@score_bazel_platforms//:x86_64-linux -common:qnx_x86_64 --platforms=@score_bazel_platforms//:x86_64-qnx +common:qnx_x86_64 --platforms=@score_bazel_platforms//:x86_64-qnx8_0 common:qnx_x86_64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64 common:qnx_x86_64 --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64 common:qnx_x86_64 --credential_helper=*.qnx.com=%workspace%/third_party/qnx_credential_helper.py diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml new file mode 100644 index 000000000..baa8b26db --- /dev/null +++ b/.github/workflows/build_and_test_qnx.yml @@ -0,0 +1,61 @@ +# ******************************************************************************* +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +# Workflow configuration for S-CORE CI - Bazel Build & Test communication module for target platforms +# This workflow runs Bazel build and test for QNX when triggered by specific pull request events. + +name: Bazel Build & Test communication module (target-platforms) +on: + pull_request: + types: [opened, reopened, synchronize] + merge_group: + types: [checks_requested] +env: + LICENSE_DIR: "/opt/score_qnx/license" +jobs: + build_and_test_qnx: + strategy: + matrix: + bazel-config: ["qnx_x86_64"] + # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 + runs-on: ubuntu-22.04 + permissions: + contents: read + pull-requests: read + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.15.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }}-${{ matrix.bazel-config }} + repository-cache: true + - name: Setup QNX License + if: ${{ contains(matrix.bazel-config, 'qnx') }} + env: + SCORE_QNX_LICENSE: ${{ secrets.SCORE_QNX_LICENSE }} + run: | + set -euo pipefail + + sudo mkdir -p "${{ env.LICENSE_DIR }}" + echo "${SCORE_QNX_LICENSE}" | base64 --decode | sudo tee "${{ env.LICENSE_DIR }}/licenses" >/dev/null + - name: Build targets + env: + SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }} + SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }} + run: | + bazel build --config ${{ matrix.bazel-config }} -- //score/... -//score/mw/com/requirements/... -//score/mw/com/example/... -//score/mw/com/performance_benchmarks/... -//score/mw/com/impl/plumbing:sample_ptr_rs -//score/mw/com/impl/rust/... + - name: Cleanup QNX License + if: ${{ contains(matrix.bazel-config, 'qnx') && !cancelled() }} + run: sudo rm -rf ${{ env.LICENSE_DIR }} diff --git a/MODULE.bazel b/MODULE.bazel index cd6dc2f2c..d4a6057fc 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -123,7 +123,7 @@ bazel_dep(name = "rules_doxygen", version = "2.5.0") bazel_dep(name = "score_baselibs", version = "0.2.0") git_override( module_name = "score_baselibs", - commit = "c500d9a42c1af52fed78c6d38c780ade4d49a2b6", + commit = "3684525abb535b44d6d5176ee6a81d57743e1a3a", remote = "https://github.com/eclipse-score/baselibs.git", ) @@ -167,7 +167,7 @@ pip.parse( ) use_repo(pip, "lobster_dependencies") -bazel_dep(name = "score_toolchains_qnx", version = "0.0.5", dev_dependency = True) +bazel_dep(name = "score_toolchains_qnx", version = "0.0.6", dev_dependency = True) toolchains_qnx = use_extension( "@score_toolchains_qnx//:extensions.bzl", From dd34b48a3df10837e007312dde02d1972f266acc Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Wed, 17 Dec 2025 15:26:36 +0100 Subject: [PATCH 02/12] Add configuration for QNX on arm64 --- .bazelrc | 8 ++++++++ MODULE.bazel | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.bazelrc b/.bazelrc index 2342b0d96..9aef1cbd8 100644 --- a/.bazelrc +++ b/.bazelrc @@ -35,6 +35,14 @@ common:qnx_x86_64 --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64 common:qnx_x86_64 --credential_helper=*.qnx.com=%workspace%/third_party/qnx_credential_helper.py common:qnx_x86_64 --sandbox_writable_path=/var/tmp +common:qnx_arm64 --host_platform=@score_bazel_platforms//:x86_64-linux +common:qnx_arm64 --platforms=@score_bazel_platforms//:arm64-qnx8_0 +common:qnx_arm64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64 +common:qnx_arm64 --extra_toolchains=@toolchains_qnx_qcc//:qcc_aarch64 +common:qnx_arm64 --extra_toolchains=@score_toolchains_rust//toolchains/aarch64-unknown-qnx8_0:toolchain_aarch64_qnx8_0 +common:qnx_arm64 --credential_helper=*.qnx.com=%workspace%/third_party/qnx_credential_helper.py +common:qnx_arm64 --sandbox_writable_path=/var/tmp + # unshare /dev/shm and /tmp test --sandbox_tmpfs_path=/dev/shm test --sandbox_tmpfs_path=/tmp diff --git a/MODULE.bazel b/MODULE.bazel index d4a6057fc..945c4ff8a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -80,6 +80,23 @@ llvm.toolchain( ) use_repo(llvm, "llvm_toolchain") +# Toolchain for Rust on QNX8 +bazel_dep(name = "rust_qnx8_toolchain", version = "1.0.0", dev_dependency = True) +archive_override( + module_name = "rust_qnx8_toolchain", + strip_prefix = "qnx8", + urls = [ + "https://github.com/qorix-group/rust-lang-qnx8/releases/download/1.0.0/qnx8_rust_toolchain.tar.gz", + ], +) + +bazel_dep(name = "score_toolchains_rust", version = "0.1", dev_dependency = True) +git_override( + module_name = "score_toolchains_rust", + commit = "bcf8e5364f72cf136ec81960350a82e2b5c45449", + remote = "https://github.com/eclipse-score/toolchains_rust.git", +) + # We use here a pre-compiled fully static and hermetic clang_format binary # and not the one provided by llvm_toolchain, because the one from llvm_toolchain is not fully hermetic (and different version for now) download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file") From 73329a415eedfa5d3763a0b1dcda5c78e27d8db0 Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Wed, 17 Dec 2025 15:45:50 +0100 Subject: [PATCH 03/12] Do not fail fast in matrix builds For our current matrix builds we are inerested in the outcome of every branch independent of the other branches. --- .github/workflows/build_and_test_host.yml | 1 + .github/workflows/build_and_test_qnx.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build_and_test_host.yml b/.github/workflows/build_and_test_host.yml index 87a356deb..0bc43dccf 100644 --- a/.github/workflows/build_and_test_host.yml +++ b/.github/workflows/build_and_test_host.yml @@ -23,6 +23,7 @@ on: jobs: build_and_test_host: strategy: + fail-fast: false matrix: toolchain: ["@llvm_toolchain//:cc-toolchain-x86_64-linux", "@gcc_toolchain//:host_gcc_12"] include: diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml index baa8b26db..227212b4b 100644 --- a/.github/workflows/build_and_test_qnx.yml +++ b/.github/workflows/build_and_test_qnx.yml @@ -25,6 +25,7 @@ env: jobs: build_and_test_qnx: strategy: + fail-fast: false matrix: bazel-config: ["qnx_x86_64"] # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 From 65f3aeaaa6d9108eed783b37c05c47d22949207b Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Wed, 17 Dec 2025 16:13:52 +0100 Subject: [PATCH 04/12] Bump Clang to 19.1.0 --- .../address_undefined_behavior_leak_sanitizer.yml | 3 --- .github/workflows/build_and_test_host.yml | 9 --------- .github/workflows/thread_sanitizer.yml | 3 --- MODULE.bazel | 2 +- 4 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/address_undefined_behavior_leak_sanitizer.yml b/.github/workflows/address_undefined_behavior_leak_sanitizer.yml index a7784992f..3b655035f 100644 --- a/.github/workflows/address_undefined_behavior_leak_sanitizer.yml +++ b/.github/workflows/address_undefined_behavior_leak_sanitizer.yml @@ -26,9 +26,6 @@ jobs: # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 steps: - - name: Install non-hermetic dependencies # Fixes https://github.com/bazel-contrib/toolchains_llvm/issues/403 - run: | - sudo apt-get install -y libtinfo5 - uses: bazel-contrib/setup-bazel@0.15.0 with: bazelisk-cache: true diff --git a/.github/workflows/build_and_test_host.yml b/.github/workflows/build_and_test_host.yml index 0bc43dccf..e0656b21e 100644 --- a/.github/workflows/build_and_test_host.yml +++ b/.github/workflows/build_and_test_host.yml @@ -26,18 +26,9 @@ jobs: fail-fast: false matrix: toolchain: ["@llvm_toolchain//:cc-toolchain-x86_64-linux", "@gcc_toolchain//:host_gcc_12"] - include: - - toolchain: "@llvm_toolchain//:cc-toolchain-x86_64-linux" - non_hermetic_dependencies: - - "libtinfo5" # Fixes https://github.com/bazel-contrib/toolchains_llvm/issues/403 # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 steps: - - name: Install non-hermetic dependencies - if: ${{ matrix.non_hermetic_dependencies }} - run: | - sudo apt-get update && true - sudo apt install -y ${{ join(matrix.non_hermetic_dependencies, ' ') }} - uses: bazel-contrib/setup-bazel@0.15.0 with: bazelisk-cache: true diff --git a/.github/workflows/thread_sanitizer.yml b/.github/workflows/thread_sanitizer.yml index f20d8313b..d0c7aeb7f 100644 --- a/.github/workflows/thread_sanitizer.yml +++ b/.github/workflows/thread_sanitizer.yml @@ -25,9 +25,6 @@ jobs: # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 steps: - - name: Install non-hermetic dependencies # Fixes https://github.com/bazel-contrib/toolchains_llvm/issues/403 - run: | - sudo apt-get install -y libtinfo5 - uses: bazel-contrib/setup-bazel@0.15.0 with: bazelisk-cache: true diff --git a/MODULE.bazel b/MODULE.bazel index 945c4ff8a..80555b218 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -75,7 +75,7 @@ llvm.toolchain( link_libs = {"": [ "-lrt", ]}, - llvm_version = "16.0.0", + llvm_version = "19.1.0", stdlib = {"": "dynamic-stdc++"}, ) use_repo(llvm, "llvm_toolchain") From d5b36d80736821757a6d79c660c2bba121009b20 Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Wed, 17 Dec 2025 15:27:08 +0100 Subject: [PATCH 05/12] Test build for QNX8 on both architectures --- .github/workflows/build_and_test_qnx.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml index 227212b4b..1f2a7a2e7 100644 --- a/.github/workflows/build_and_test_qnx.yml +++ b/.github/workflows/build_and_test_qnx.yml @@ -27,7 +27,19 @@ jobs: strategy: fail-fast: false matrix: - bazel-config: ["qnx_x86_64"] + bazel-config: ["qnx_x86_64", "qnx_arm64"] + include: + - bazel-config: "qnx_x86_64" + incompatible_targets: + - "-//score/mw/com/requirements/..." # Uninvestigated problem + - "-//score/mw/com/performance_benchmarks/..." # Uninvestigated problem + - "-//score/mw/com/example/..." # Missing Rust toolchain support for QNX8 on x86_64 + - "-//score/mw/com/impl/plumbing:sample_ptr_rs" # Missing Rust toolchain support for QNX8 on x86_64 + - "-//score/mw/com/impl/rust/..." # Missing Rust toolchain support for QNX8 on x86_64 + - bazel-config: "qnx_arm64" + incompatible_targets: + - "-//score/mw/com/requirements/..." # Uninvestigated problem + - "-//score/mw/com/performance_benchmarks/..." # Uninvestigated problem # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 permissions: @@ -56,7 +68,7 @@ jobs: SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }} SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }} run: | - bazel build --config ${{ matrix.bazel-config }} -- //score/... -//score/mw/com/requirements/... -//score/mw/com/example/... -//score/mw/com/performance_benchmarks/... -//score/mw/com/impl/plumbing:sample_ptr_rs -//score/mw/com/impl/rust/... + bazel build --config ${{ matrix.bazel-config }} -- //score/... ${{ join(matrix.incompatible_targets, ' ') }} - name: Cleanup QNX License if: ${{ contains(matrix.bazel-config, 'qnx') && !cancelled() }} run: sudo rm -rf ${{ env.LICENSE_DIR }} From 46172fc7f6cc7718b927a07ac2455c46fd072db2 Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Wed, 17 Dec 2025 17:09:51 +0100 Subject: [PATCH 06/12] Disable Rust build also on QNX8 arm64 Build fails because the rust toolchain is not hermetic. --- .bazelrc | 1 - .github/workflows/build_and_test_qnx.yml | 3 +++ MODULE.bazel | 17 ----------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.bazelrc b/.bazelrc index 9aef1cbd8..677dad730 100644 --- a/.bazelrc +++ b/.bazelrc @@ -39,7 +39,6 @@ common:qnx_arm64 --host_platform=@score_bazel_platforms//:x86_64-linux common:qnx_arm64 --platforms=@score_bazel_platforms//:arm64-qnx8_0 common:qnx_arm64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64 common:qnx_arm64 --extra_toolchains=@toolchains_qnx_qcc//:qcc_aarch64 -common:qnx_arm64 --extra_toolchains=@score_toolchains_rust//toolchains/aarch64-unknown-qnx8_0:toolchain_aarch64_qnx8_0 common:qnx_arm64 --credential_helper=*.qnx.com=%workspace%/third_party/qnx_credential_helper.py common:qnx_arm64 --sandbox_writable_path=/var/tmp diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml index 1f2a7a2e7..ab4a5df0c 100644 --- a/.github/workflows/build_and_test_qnx.yml +++ b/.github/workflows/build_and_test_qnx.yml @@ -40,6 +40,9 @@ jobs: incompatible_targets: - "-//score/mw/com/requirements/..." # Uninvestigated problem - "-//score/mw/com/performance_benchmarks/..." # Uninvestigated problem + - "-//score/mw/com/example/..." # Broken Rust toolchain for QNX8 on arm64 + - "-//score/mw/com/impl/plumbing:sample_ptr_rs" # Broken Rust toolchain for QNX8 on arm64 + - "-//score/mw/com/impl/rust/..." # Broken Rust toolchain for QNX8 on arm64 # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 permissions: diff --git a/MODULE.bazel b/MODULE.bazel index 80555b218..1181fd894 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -80,23 +80,6 @@ llvm.toolchain( ) use_repo(llvm, "llvm_toolchain") -# Toolchain for Rust on QNX8 -bazel_dep(name = "rust_qnx8_toolchain", version = "1.0.0", dev_dependency = True) -archive_override( - module_name = "rust_qnx8_toolchain", - strip_prefix = "qnx8", - urls = [ - "https://github.com/qorix-group/rust-lang-qnx8/releases/download/1.0.0/qnx8_rust_toolchain.tar.gz", - ], -) - -bazel_dep(name = "score_toolchains_rust", version = "0.1", dev_dependency = True) -git_override( - module_name = "score_toolchains_rust", - commit = "bcf8e5364f72cf136ec81960350a82e2b5c45449", - remote = "https://github.com/eclipse-score/toolchains_rust.git", -) - # We use here a pre-compiled fully static and hermetic clang_format binary # and not the one provided by llvm_toolchain, because the one from llvm_toolchain is not fully hermetic (and different version for now) download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file") From 3622d3d536a220eb198f494694490aac27042d11 Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Thu, 18 Dec 2025 08:53:09 +0100 Subject: [PATCH 07/12] Clean runners to get more disk space --- ...ress_undefined_behavior_leak_sanitizer.yml | 6 ++-- .github/workflows/build_and_test_host.yml | 6 ++-- .github/workflows/build_and_test_qnx.yml | 2 ++ .github/workflows/thread_sanitizer.yml | 6 ++-- actions/free_disk_space/action.yml | 32 +++++++++++++++++++ 5 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 actions/free_disk_space/action.yml diff --git a/.github/workflows/address_undefined_behavior_leak_sanitizer.yml b/.github/workflows/address_undefined_behavior_leak_sanitizer.yml index 3b655035f..b3af15c35 100644 --- a/.github/workflows/address_undefined_behavior_leak_sanitizer.yml +++ b/.github/workflows/address_undefined_behavior_leak_sanitizer.yml @@ -26,13 +26,15 @@ jobs: # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + - name: Free Disk Space (Ubuntu) + uses: ./actions/free_disk_space - uses: bazel-contrib/setup-bazel@0.15.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }} repository-cache: true - - name: Checkout repository - uses: actions/checkout@v4.2.2 - name: Bazel test communication targets with address and UB and leak sanitizer run: | bazel test --config=asan_ubsan_lsan //... --build_tests_only diff --git a/.github/workflows/build_and_test_host.yml b/.github/workflows/build_and_test_host.yml index e0656b21e..816231175 100644 --- a/.github/workflows/build_and_test_host.yml +++ b/.github/workflows/build_and_test_host.yml @@ -29,13 +29,15 @@ jobs: # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + - name: Free Disk Space (Ubuntu) + uses: ./actions/free_disk_space - uses: bazel-contrib/setup-bazel@0.15.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-${{ matrix.toolchain }} repository-cache: true - - name: Checkout repository - uses: actions/checkout@v4.2.2 - name: Bazel build communication targets run: | bazel build --extra_toolchains=${{ matrix.toolchain }} //... diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml index ab4a5df0c..44b8e45ab 100644 --- a/.github/workflows/build_and_test_qnx.yml +++ b/.github/workflows/build_and_test_qnx.yml @@ -51,6 +51,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4.2.2 + - name: Free Disk Space (Ubuntu) + uses: ./actions/free_disk_space - name: Setup Bazel uses: bazel-contrib/setup-bazel@0.15.0 with: diff --git a/.github/workflows/thread_sanitizer.yml b/.github/workflows/thread_sanitizer.yml index d0c7aeb7f..e30ef7886 100644 --- a/.github/workflows/thread_sanitizer.yml +++ b/.github/workflows/thread_sanitizer.yml @@ -25,13 +25,15 @@ jobs: # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 runs-on: ubuntu-22.04 steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + - name: Free Disk Space (Ubuntu) + uses: ./actions/free_disk_space - uses: bazel-contrib/setup-bazel@0.15.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }} repository-cache: true - - name: Checkout repository - uses: actions/checkout@v4.2.2 - name: Bazel test communication targets with thread sanitizer run: | bazel test --config=tsan //... --build_tests_only diff --git a/actions/free_disk_space/action.yml b/actions/free_disk_space/action.yml new file mode 100644 index 000000000..cc6aff23c --- /dev/null +++ b/actions/free_disk_space/action.yml @@ -0,0 +1,32 @@ +# ******************************************************************************* +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +name: "Free Disk Space" +description: "Configures and calls endersonmenezes/free-disk-space to free disk space" + +branding: + icon: command + color: gray-dark + +runs: + using: composite + steps: + - name: Free Disk Space (Ubuntu) + uses: endersonmenezes/free-disk-space@v3 + with: + remove_android: true + remove_dotnet: true + remove_haskell: true + remove_tool_cache: true + remove_swap: true + rm_cmd: "rmz" From 6709ebbb26876724aa19e665b27fc1c3b1f3386a Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Thu, 18 Dec 2025 17:26:19 +0100 Subject: [PATCH 08/12] Add TODO for tests on QNX --- .github/workflows/build_and_test_qnx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml index 44b8e45ab..2d0c0f49b 100644 --- a/.github/workflows/build_and_test_qnx.yml +++ b/.github/workflows/build_and_test_qnx.yml @@ -77,3 +77,4 @@ jobs: - name: Cleanup QNX License if: ${{ contains(matrix.bazel-config, 'qnx') && !cancelled() }} run: sudo rm -rf ${{ env.LICENSE_DIR }} + # TODO Run tests on QNX QEMU From 6675111bfb59906989e6cd3e82e67c1ea17463ac Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Thu, 18 Dec 2025 15:07:24 +0100 Subject: [PATCH 09/12] Bump baselibs --- MODULE.bazel | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 1181fd894..00026fa18 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -120,12 +120,7 @@ download_archive( bazel_dep(name = "nlohmann_json", version = "3.11.3") bazel_dep(name = "bazel_skylib", version = "1.8.1") bazel_dep(name = "rules_doxygen", version = "2.5.0") -bazel_dep(name = "score_baselibs", version = "0.2.0") -git_override( - module_name = "score_baselibs", - commit = "3684525abb535b44d6d5176ee6a81d57743e1a3a", - remote = "https://github.com/eclipse-score/baselibs.git", -) +bazel_dep(name = "score_baselibs", version = "0.2.2") # Doxygen extension for documentation generation doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension") From 7c9fa0220f393ed93cb24fe55c2d11de0c134766 Mon Sep 17 00:00:00 2001 From: Piotr Korkus Date: Wed, 17 Dec 2025 11:27:55 +0100 Subject: [PATCH 10/12] cicd: add release workflow execute tests and store artifacts --- .github/workflows/release.yml | 134 ++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..d89a1f765 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,134 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +name: Release Verification + +on: + release: + types: [created] + +jobs: + archive-report: + runs-on: ubuntu-22.04 + permissions: + contents: write # required to upload release assets + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.2.2 + + - name: Install lcov and libtinfo5 + run: | + sudo apt-get update + sudo apt-get install -y lcov libtinfo5 + + - name: Setup Bazel with shared caching + uses: bazel-contrib/setup-bazel@0.15.0 + with: + disk-cache: true + repository-cache: true + bazelisk-cache: true + + - name: Bazel info (discover paths) + id: bazel-info + run: | + echo "BAZEL_OUTPUT_BASE=$(bazel info output_base)" >> $GITHUB_ENV + echo "BAZEL_USER_ROOT=$(bazel info output_user_root)" >> $GITHUB_ENV + echo "BAZEL_REPO_CACHE=$(bazel info repository_cache)" >> $GITHUB_ENV + bazel info + + - name: Cache Bazel output base + uses: actions/cache@v4 + with: + path: | + ${{ env.BAZEL_OUTPUT_BASE }}/action_cache + ${{ env.BAZEL_OUTPUT_BASE }}/bazel-out + ${{ env.BAZEL_OUTPUT_BASE }}/external + ${{ env.BAZEL_OUTPUT_BASE }}/execroot + key: bazel-ob-v2-${{ runner.os }}-${{ hashFiles('.bazelversion', 'MODULE.bazel', 'MODULE.bazel.lock', '**/*.bzl', 'Cargo.lock') }} + restore-keys: | + bazel-ob-v2-${{ runner.os }}- + + - name: Aggressive cleanup + run: | + echo "Before cleanup:" + df -h + + # Remove .NET SDKs + sudo rm -rf /usr/share/dotnet + + # Remove Swift toolchain + sudo rm -rf /usr/share/swift + + # Remove Haskell (GHC) + sudo rm -rf /usr/local/.ghcup + + # Remove Julia + sudo rm -rf /usr/local/julia* + + # Remove Android SDKs + sudo rm -rf /usr/local/lib/android + + # Remove Chromium (optional if not using for browser tests) + sudo rm -rf /usr/local/share/chromium + + echo "After cleanup:" + df -h + + - name: Build via Bazel + run: | + echo "Running: bazel build //src/..." + bazel build //... + + - name: Run Unit Tests via Bazel + run: | + echo "Running: bazel test //:unit_tests" + bazel test //... --build_tests_only + + - name: Run Unit Test with Coverage for C++ + run: | + # Run tests + bazel coverage //... \ + --build_tests_only \ + --collect_code_coverage \ + --combined_report=lcov \ + --experimental_generate_llvm_lcov \ + --nocache_test_results \ + --nostamp + # Generate HTML report + genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \ + -o=cpp_coverage \ + --show-details \ + --legend \ + --function-coverage \ + --branch-coverage + + - name: Create archive of test report + run: | + mkdir -p artifacts + find bazel-testlogs/score/ -name 'test.xml' -print0 | xargs -0 -I{} cp --parents {} artifacts/ + cp -r cpp_coverage artifacts/ + zip -r ${{ github.event.repository.name }}_coverage_report.zip artifacts/ + shell: bash + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}_coverage_report.zip + path: ${{ github.event.repository.name }}_coverage_report.zip + + - name: Upload release asset (attach ZIP to GitHub Release) + uses: softprops/action-gh-release@v2.5.0 + with: + files: ${{ github.event.repository.name }}_coverage_report.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 169090f68d074ea3dadb17bd62e82da14052394a Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Thu, 18 Dec 2025 18:22:12 +0100 Subject: [PATCH 11/12] Adapt release workflow to use module infrastructure --- .github/workflows/release.yml | 78 ++++++----------------------------- 1 file changed, 12 insertions(+), 66 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d89a1f765..7a84b3143 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ name: Release Verification on: release: - types: [created] + types: [ created ] jobs: archive-report: @@ -26,85 +26,31 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Install lcov and libtinfo5 + - name: Free Disk Space (Ubuntu) + uses: ./actions/free_disk_space + + - name: Install lcov run: | sudo apt-get update - sudo apt-get install -y lcov libtinfo5 + sudo apt-get install -y lcov - name: Setup Bazel with shared caching uses: bazel-contrib/setup-bazel@0.15.0 with: - disk-cache: true - repository-cache: true bazelisk-cache: true - - - name: Bazel info (discover paths) - id: bazel-info - run: | - echo "BAZEL_OUTPUT_BASE=$(bazel info output_base)" >> $GITHUB_ENV - echo "BAZEL_USER_ROOT=$(bazel info output_user_root)" >> $GITHUB_ENV - echo "BAZEL_REPO_CACHE=$(bazel info repository_cache)" >> $GITHUB_ENV - bazel info - - - name: Cache Bazel output base - uses: actions/cache@v4 - with: - path: | - ${{ env.BAZEL_OUTPUT_BASE }}/action_cache - ${{ env.BAZEL_OUTPUT_BASE }}/bazel-out - ${{ env.BAZEL_OUTPUT_BASE }}/external - ${{ env.BAZEL_OUTPUT_BASE }}/execroot - key: bazel-ob-v2-${{ runner.os }}-${{ hashFiles('.bazelversion', 'MODULE.bazel', 'MODULE.bazel.lock', '**/*.bzl', 'Cargo.lock') }} - restore-keys: | - bazel-ob-v2-${{ runner.os }}- - - - name: Aggressive cleanup - run: | - echo "Before cleanup:" - df -h - - # Remove .NET SDKs - sudo rm -rf /usr/share/dotnet - - # Remove Swift toolchain - sudo rm -rf /usr/share/swift - - # Remove Haskell (GHC) - sudo rm -rf /usr/local/.ghcup - - # Remove Julia - sudo rm -rf /usr/local/julia* - - # Remove Android SDKs - sudo rm -rf /usr/local/lib/android - - # Remove Chromium (optional if not using for browser tests) - sudo rm -rf /usr/local/share/chromium - - echo "After cleanup:" - df -h + disk-cache: ${{ github.workflow }} + repository-cache: true - name: Build via Bazel run: | - echo "Running: bazel build //src/..." bazel build //... - - name: Run Unit Tests via Bazel + - name: Run Unit Test with Coverage for C++ run: | - echo "Running: bazel test //:unit_tests" - bazel test //... --build_tests_only + bazel coverage //... --build_tests_only - - name: Run Unit Test with Coverage for C++ + - name: Generate HTML Coverage Report run: | - # Run tests - bazel coverage //... \ - --build_tests_only \ - --collect_code_coverage \ - --combined_report=lcov \ - --experimental_generate_llvm_lcov \ - --nocache_test_results \ - --nostamp - # Generate HTML report genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \ -o=cpp_coverage \ --show-details \ @@ -120,7 +66,7 @@ jobs: zip -r ${{ github.event.repository.name }}_coverage_report.zip artifacts/ shell: bash - - name: Upload artifacts + - name: Upload coverage artifacts uses: actions/upload-artifact@v4 with: name: ${{ github.event.repository.name }}_coverage_report.zip From 0f532eec1a10e4b82a764be07524e6f82b4c652c Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Fri, 19 Dec 2025 08:56:51 +0100 Subject: [PATCH 12/12] Rename Release Verification Workflow to Coverage Report Workflow We do not want to duplicate the logic of the workflows. Since we have the logic except for coverage reports already as part of other workflows we reduce this workflow to only create a coverage report. All the other workflows we enable to also be triggered by a release creation. --- .../address_undefined_behavior_leak_sanitizer.yml | 2 ++ .github/workflows/build_and_test_host.yml | 2 ++ .github/workflows/build_and_test_qnx.yml | 2 ++ .../{release.yml => release_coverage_report.yml} | 8 ++------ .github/workflows/thread_sanitizer.yml | 2 ++ 5 files changed, 10 insertions(+), 6 deletions(-) rename .github/workflows/{release.yml => release_coverage_report.yml} (95%) diff --git a/.github/workflows/address_undefined_behavior_leak_sanitizer.yml b/.github/workflows/address_undefined_behavior_leak_sanitizer.yml index b3af15c35..662dd2ae6 100644 --- a/.github/workflows/address_undefined_behavior_leak_sanitizer.yml +++ b/.github/workflows/address_undefined_behavior_leak_sanitizer.yml @@ -21,6 +21,8 @@ on: types: [opened, reopened, synchronize] merge_group: types: [checks_requested] + release: + types: [created] jobs: build_and_test_asan_ubsan_lsan: # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081 diff --git a/.github/workflows/build_and_test_host.yml b/.github/workflows/build_and_test_host.yml index 816231175..1f951ce6d 100644 --- a/.github/workflows/build_and_test_host.yml +++ b/.github/workflows/build_and_test_host.yml @@ -20,6 +20,8 @@ on: types: [opened, reopened, synchronize] merge_group: types: [checks_requested] + release: + types: [created] jobs: build_and_test_host: strategy: diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml index 2d0c0f49b..01f6bf1aa 100644 --- a/.github/workflows/build_and_test_qnx.yml +++ b/.github/workflows/build_and_test_qnx.yml @@ -20,6 +20,8 @@ on: types: [opened, reopened, synchronize] merge_group: types: [checks_requested] + release: + types: [created] env: LICENSE_DIR: "/opt/score_qnx/license" jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release_coverage_report.yml similarity index 95% rename from .github/workflows/release.yml rename to .github/workflows/release_coverage_report.yml index 7a84b3143..ff83581cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release_coverage_report.yml @@ -10,14 +10,14 @@ # # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -name: Release Verification +name: Coverage Report on: release: types: [ created ] jobs: - archive-report: + coverage-report: runs-on: ubuntu-22.04 permissions: contents: write # required to upload release assets @@ -41,10 +41,6 @@ jobs: disk-cache: ${{ github.workflow }} repository-cache: true - - name: Build via Bazel - run: | - bazel build //... - - name: Run Unit Test with Coverage for C++ run: | bazel coverage //... --build_tests_only diff --git a/.github/workflows/thread_sanitizer.yml b/.github/workflows/thread_sanitizer.yml index e30ef7886..f7af16b6b 100644 --- a/.github/workflows/thread_sanitizer.yml +++ b/.github/workflows/thread_sanitizer.yml @@ -20,6 +20,8 @@ on: types: [opened, reopened, synchronize] merge_group: types: [checks_requested] + release: + types: [created] jobs: build_and_test_tsan: # Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081