Skip to content
Closed
9 changes: 8 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,19 @@ 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
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 --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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ 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
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
- 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
18 changes: 7 additions & 11 deletions .github/workflows/build_and_test_host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,26 @@ on:
types: [opened, reopened, synchronize]
merge_group:
types: [checks_requested]
release:
types: [created]
jobs:
build_and_test_host:
strategy:
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, ' ') }}
- 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 }} //...
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/build_and_test_qnx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# *******************************************************************************
# 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this use reusable QNX8 workflow from https://github.com/eclipse-score/cicd-workflows ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I can't use the upstream workflows for various reasons.
Though, I want to upstream fixes to cicd-workflows to slowly lift this restriction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean you will create PRs to reusable workflows?

on:
pull_request:
types: [opened, reopened, synchronize]
merge_group:
types: [checks_requested]
release:
types: [created]
env:
LICENSE_DIR: "/opt/score_qnx/license"
jobs:
build_and_test_qnx:
strategy:
fail-fast: false
matrix:
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
- "-//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:
contents: read
pull-requests: read
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:
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/... ${{ join(matrix.incompatible_targets, ' ') }}
- name: Cleanup QNX License
if: ${{ contains(matrix.bazel-config, 'qnx') && !cancelled() }}
run: sudo rm -rf ${{ env.LICENSE_DIR }}
# TODO Run tests on QNX QEMU
76 changes: 76 additions & 0 deletions .github/workflows/release_coverage_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# *******************************************************************************
# 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: Coverage Report

on:
release:
types: [ created ]

jobs:
coverage-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: Free Disk Space (Ubuntu)
uses: ./actions/free_disk_space

- name: Install lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Run Unit Test with Coverage for C++
run: |
bazel coverage //... --build_tests_only

- name: Generate HTML Coverage Report
run: |
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 coverage 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 }}
11 changes: 6 additions & 5 deletions .github/workflows/thread_sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ 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
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
- 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
11 changes: 3 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 = "c500d9a42c1af52fed78c6d38c780ade4d49a2b6",
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")
Expand Down Expand Up @@ -167,7 +162,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",
Expand Down
32 changes: 32 additions & 0 deletions actions/free_disk_space/action.yml
Original file line number Diff line number Diff line change
@@ -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"