Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ build --java_language_version=17
build --tool_java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_runtime_version=remotejdk_17
build --@score_baselibs//score/json:base_library=nlohmann

test --test_output=errors

common --@score_baselibs//score/json:base_library=nlohmann
common --@score_communication//score/mw/com/flags:tracing_library=stub
common --//score/config_management/config_daemon/code:score_variant=True
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
common --registry=https://bcr.bazel.build

# Host GCC toolchain — used by CI (tests.yml, static-analysis.yml)
# gcc_toolchain module extension generates @gcc_toolchain_x86_64//:cc_toolchain
build:host_gcc --extra_toolchains=@gcc_toolchain_x86_64//:cc_toolchain
build:host_gcc --host_platform=@score_bazel_platforms//:x86_64-linux
21 changes: 7 additions & 14 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Comment out as not in score yet
# * @eclipse-score/infrastructure-tooling-community
# .* @eclipse-score/infrastructure-tooling-community
# .github/CODEOWNERS @eclipse-score/technical-lead
# 👋 Code owners help maintain this repository and keep it aligned with our technical vision.
# You're responsible for reviewing changes, ensuring quality, and guiding contributors.
# For more information about CODEOWNERS, see:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# in separate <module_name> repositories:
#
# /docs @eclipse-score/process-community
# /docs/manual @eclipse-score/<module_name>/safety-manager
# /docs/release @eclipse-score/<module_name>/quality-manager @eclipse-score/<module_name>/module-lead
# /docs/safety_plan @eclipse-score/<module_name>/safety-manager @eclipse-score/<module_name>/module-lead
# /docs/safety_analysis @eclipse-score/<module_name>/safety-manager
# /docs/verification @eclipse-score/<module_name>/quality-manager @eclipse-score/<module_name>/safety-manager
# /components @eclipse-score/<module_name>/technical-lead
# /components/*/ @eclipse-score/<module_name>/automotive-score-committers
# As we cannot use groups yet, we list all members explicitly.
# Default owners for everything in the repository
* @antonkri @castler @LittleHuba @ramceb @luizcordeiro @michaelsaborov
29 changes: 29 additions & 0 deletions .github/workflows/bzlmod-lock-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# *******************************************************************************
# 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: Bzlmod Lockfile Check

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
merge_group:
types: [checks_requested]

jobs:
bzlmod-lock:
uses: eclipse-score/cicd-workflows/.github/workflows/bzlmod-lock-check.yml@main
with:
working-directory: .
2 changes: 1 addition & 1 deletion .github/workflows/deps-whitelist-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
jobs:
build-acceptlist-check:
name: Build whitelisted CfgD & CfgP targets
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
lint-commits:
name: check-commit-messages
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/score-pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# *******************************************************************************
# 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: SCORE PR Checks

on:
pull_request:
branches:
- main

jobs:
bazel-module-name-check:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check MODULE.bazel and validate module name
run: |
if [ ! -f "MODULE.bazel" ]; then
echo "ℹ️ MODULE.bazel file not found - skipping"
exit 0
fi
echo "✅ MODULE.bazel file found"
# Extract name= value robustly across single-line and multi-line module()
MODULE_NAME=$(grep -oP '(?<=name\s=\s")[^"]+' MODULE.bazel | head -1)
echo "Found module name: $MODULE_NAME"
if [[ ! "$MODULE_NAME" =~ ^score_[[:lower:]_]+$ ]]; then
echo "❌ Invalid module name: $MODULE_NAME"
echo "Module name must match the pattern: ^score_[[:lower:]_]+$"
exit 1
fi
echo "✅ Module name is valid: $MODULE_NAME"
61 changes: 61 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# *******************************************************************************
# 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: Static Analysis

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
merge_group:
types: [checks_requested]

jobs:
static-analysis:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run clang-tidy on all targets from deps_whitelist.json
run: |
python3 - <<'PYEOF'
import json, subprocess, sys

ACCEPTLIST = "score/config_management/deps_whitelist.json"

with open(ACCEPTLIST) as f:
targets = json.load(f)["clang_tidy_targets"]

failures = []
for target in targets:
result = subprocess.run(
["bazel", "build", target, "--config=host_gcc"],
capture_output=True, text=True
)
if result.returncode == 0:
print(f" OK {target}")
else:
failures.append(target)
print(f" FAIL {target}")
print(result.stderr[-2000:])

print(f"\n{len(targets) - len(failures)}/{len(targets)} clang-tidy targets passed.")

if failures:
print("\nStatic analysis failed for the following targets:")
for t in failures:
print(f" {t}")
sys.exit(1)
PYEOF
60 changes: 60 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# *******************************************************************************
# 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: Tests CI

on:
pull_request:
push:
branches:
- main
merge_group:
types: [checks_requested]

jobs:
tests:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run tests from deps_whitelist.json
run: |
python3 - <<'PYEOF'
import json, subprocess, sys

ACCEPTLIST = "score/config_management/deps_whitelist.json"

with open(ACCEPTLIST) as f:
targets = json.load(f)["test_targets"]

failures = []
for target in targets:
result = subprocess.run(
["bazel", "test", target, "--config=host_gcc"],
capture_output=True, text=True
)
if result.returncode == 0:
print(f" PASS {target}")
else:
failures.append(target)
print(f" FAIL {target}")
print(result.stderr[-2000:])

print(f"\n{len(targets) - len(failures)}/{len(targets)} tests passed.")

if failures:
print("\nTests failed for the following targets:")
for t in failures:
print(f" {t}")
sys.exit(1)
PYEOF
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

# Bazel
bazel-*
MODULE.bazel.lock
user.bazelrc

# Ruff
Expand Down
87 changes: 78 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module(
)

bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_python", version = "1.4.1")
bazel_dep(name = "rules_python", version = "1.8.3")
bazel_dep(name = "platforms", version = "1.0.0")

PYTHON_VERSION = "3.12"

Expand All @@ -25,16 +26,15 @@ python.toolchain(
is_default = True,
python_version = PYTHON_VERSION,
)
use_repo(python)

# Add GoogleTest dependency
bazel_dep(name = "googletest", version = "1.17.0.bcr.1")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")

# Rust rules for Bazel
bazel_dep(name = "rules_rust", version = "0.63.0")
bazel_dep(name = "rules_rust", version = "0.68.1-score")

# C/C++ rules for Bazel
bazel_dep(name = "rules_cc", version = "0.2.1")
bazel_dep(name = "rules_cc", version = "0.2.16")

# LLVM Toolchains Rules - host configuration
bazel_dep(name = "toolchains_llvm", version = "1.4.0")
Expand All @@ -50,19 +50,88 @@ use_repo(llvm, "llvm_toolchain_llvm")
register_toolchains("@llvm_toolchain//:all")

# tooling
bazel_dep(name = "score_tooling", version = "1.0.4")
bazel_dep(name = "aspect_rules_lint", version = "1.5.3")
bazel_dep(name = "score_tooling", version = "1.1.2")
bazel_dep(name = "aspect_rules_lint", version = "2.0.0")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")

#docs-as-code
bazel_dep(name = "score_docs_as_code", version = "2.2.0")
bazel_dep(name = "score_docs_as_code", version = "3.0.1")

# Force score_docs_as_code to 3.0.1 to resolve compatibility conflict between
# score_logging and score_baselibs
single_version_override(
module_name = "score_docs_as_code",
version = "3.0.1",
)

# Force score_crates to 0.0.7 since 0.0.8 is not available in registries
single_version_override(
module_name = "score_crates",
version = "0.0.7",
)

# s-core base libs
bazel_dep(name = "score_baselibs", version = "0.2.2")
bazel_dep(name = "score_baselibs", version = "0.2.3")

# Override necessary until result_of_t fix is released.
# Pinned to commit before toolchains_llvm was added as non-dev dep.
git_override(
module_name = "score_baselibs",
commit = "052c2f271be4239f97182b164f4903b8c88d6c72",
remote = "https://github.com/eclipse-score/baselibs.git",
)

# s-core communication
bazel_dep(name = "score_communication", version = "0.1.2")

# Override necessary until S-CORE release 0.6 update,
# which shall expose mw::service stub.
git_override(
module_name = "score_communication",
branch = "main",
remote = "https://github.com/eclipse-score/communication.git",
)

bazel_dep(name = "score_logging", version = "0.1.0")
bazel_dep(name = "score_lifecycle_health", version = "0.0.1")
bazel_dep(name = "score_bazel_platforms", version = "0.1.1")

# gcc_toolchain — needed for --config=host_gcc (.bazelrc)
# score_communication declares it as dev_dependency so we must add it directly
bazel_dep(name = "gcc_toolchain", version = "0.9.0")

gcc_toolchains = use_extension("@gcc_toolchain//toolchain:module_extensions.bzl", "gcc_toolchains")
gcc_toolchains.toolchain(
name = "gcc_toolchain_x86_64",
extra_ldflags = [
"-lstdc++",
"-lrt",
"-latomic",
],
gcc_version = "15.2.0",
target_arch = "x86_64",
)
use_repo(gcc_toolchains, "gcc_toolchain_x86_64")

# Override necessary because there's no oficial release yet.
# See:
# https://github.com/eclipse-score/lifecycle/issues/35
git_override(
module_name = "score_lifecycle_health",
branch = "main",
remote = "https://github.com/eclipse-score/lifecycle.git",
)

# rules_boost is not in BCR or eclipse-score/bazel_registry;
# required transitively via score_communication and score_baselibs
# (boost.program_options / boost.interprocess -> rules_boost)
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
archive_override(
module_name = "rules_boost",
strip_prefix = "rules_boost-master",
urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
)

# TRLC dependency for requirements traceability
bazel_dep(name = "trlc", version = "0.0.0")
git_override(
Expand Down
Loading
Loading