Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ common --registry=https://bcr.bazel.build
build --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
build --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
build --@score_baselibs//score/json:base_library=nlohmann
build --@score_communication//score/mw/com/flags:tracing_library=stub
build --@communication//score/mw/com/flags:tracing_library=stub

# stop legacy behavior of creating __init__.py files
build --incompatible_default_to_explicit_init_py
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Workflow configuration for S-CORE CI - Bazel Build & Test baselibs
# This workflow runs Bazel build and test when triggered by specific pull request events.

name: Bazel Build some repositories
name: build latest mains
on:
workflow_dispatch:
push:
Expand Down Expand Up @@ -51,9 +51,21 @@ jobs:
disk-cache: ${{ github.workflow }}
# Share repository cache between workflows.
repository-cache: true
- name: Update known good commits
run: |
echo "::group::get latest commits from main branches"
python3 tools/update_module_latest.py --output known_good.updated.json
cat known_good.updated.json
echo "::endgroup::"
echo "::group::update score_modules.MODULE.bazel"
python3 tools/update_module_from_known_good.py --known known_good.updated.json
cat score_modules.MODULE.bazel
echo "::endgroup::"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bazel build targets
run: |
./integration_test.sh
./integration_test.sh --known-good known_good.updated.json
- name: Show disk space after build
if: always()
run: |
Expand Down
10 changes: 5 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ use_repo(pip, "pip_score_venv_test")

# communication module dependencies
# archive_override are not forwarded by bazel_dep, so we need to redefine it here
archive_override(
module_name = "rules_boost",
strip_prefix = "rules_boost-master",
urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
)
# archive_override(
# module_name = "rules_boost",
# strip_prefix = "rules_boost-master",
# urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
# )

# git_override are not forwarded by bazel_dep, so we need to redefine it here
git_override(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bazel build --config bl-x86_64-linux @score_baselibs//score/... --verbose_failur

### Communication
```bash
bazel build --config bl-x86_64-linux @score_communication//score/mw/com:com --verbose_failures
bazel build --config bl-x86_64-linux @communication//score/mw/com:com --verbose_failures
```

### Persistency
Expand Down
110 changes: 98 additions & 12 deletions integration_test.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,72 @@
#!/usr/bin/env bash
set -euox pipefail
set -euo pipefail

# Integration build script.
# Captures warning counts for regression tracking.
#
# Usage: ./integration_test.sh [--known-good <path>]
# --known-good: Optional path to known_good.json file

CONFIG=${CONFIG:-bl-x86_64-linux}
LOG_DIR=${LOG_DIR:-_logs/logs}
SUMMARY_FILE=${SUMMARY_FILE:-_logs/build_summary.md}
KNOWN_GOOD_FILE=""

# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--known-good)
KNOWN_GOOD_FILE="$2"
shift 2
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--known-good <path>]"
exit 1
;;
esac
done

mkdir -p "${LOG_DIR}" || true

# Function to extract commit hash from known_good.json
get_commit_hash() {
local module_name=$1
local known_good_file=$2

if [[ -z "${known_good_file}" ]] || [[ ! -f "${known_good_file}" ]]; then
echo "N/A"
return
fi

# Get the script directory
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Use the Python script to extract module info
python3 "${script_dir}/tools/get_module_info.py" "${known_good_file}" "${module_name}" "hash" 2>/dev/null || echo "N/A"
}

# Function to extract repo URL from known_good.json
get_module_repo() {
local module_name=$1
local known_good_file=$2

if [[ -z "${known_good_file}" ]] || [[ ! -f "${known_good_file}" ]]; then
echo "N/A"
return
fi

# Get the script directory
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Use the Python script to extract module repo
python3 "${script_dir}/tools/get_module_info.py" "${known_good_file}" "${module_name}" "repo" 2>/dev/null || echo "N/A"
}

declare -A BUILD_TARGET_GROUPS=(
[baselibs]="@score_baselibs//score/..."
[score_communication]="@score_communication//score/mw/com:com"
[persistency]="@score_persistency//src/cpp/src/... @score_persistency//src/rust/..."
[score_baselibs]="@score_baselibs//score/..."
[communication]="@communication//score/mw/com:com"
[score_persistency]="@score_persistency//src/cpp/src/... @score_persistency//src/rust/..."
#[score_logging]="@score_logging//src/..."
[score_orchestrator]="@score_orchestrator//src/..."
[score_test_scenarios]="@score_test_scenarios//..."
Expand All @@ -35,29 +89,41 @@ timestamp() { date '+%Y-%m-%d %H:%M:%S'; }

echo "=== Integration Build Started $(timestamp) ===" | tee "${SUMMARY_FILE}"
echo "Config: ${CONFIG}" | tee -a "${SUMMARY_FILE}"
if [[ -n "${KNOWN_GOOD_FILE}" ]]; then
echo "Known Good File: ${KNOWN_GOOD_FILE}" | tee -a "${SUMMARY_FILE}"
fi
echo "" >> "${SUMMARY_FILE}"
echo "## Build Groups Summary" >> "${SUMMARY_FILE}"
echo "" >> "${SUMMARY_FILE}"
# Markdown table header
{
echo "| Group | Status | Duration (s) | Warnings | Deprecated refs |";
echo "|-------|--------|--------------|----------|-----------------|";
echo "| Group | Status | Duration (s) | Warnings | Deprecated refs | Commit/Version |";
echo "|-------|--------|--------------|----------|-----------------|----------------|";
} >> "${SUMMARY_FILE}"

overall_warn_total=0
overall_depr_total=0

# Track if any build group failed
any_failed=0

for group in "${!BUILD_TARGET_GROUPS[@]}"; do
targets="${BUILD_TARGET_GROUPS[$group]}"
log_file="${LOG_DIR}/${group}.log"

# Log build group banner only to stdout/stderr (not into summary table file)
echo "--- Building group: ${group} ---"
start_ts=$(date +%s)
echo "bazel build --config "${CONFIG}" ${targets} --verbose_failures"
# GitHub Actions log grouping start
echo "::group::Bazel build (${group})"
start_ts=$(date +%s)
set +e
bazel build --config "${CONFIG}" ${targets} --verbose_failures 2>&1 | tee "$log_file"
build_status=${PIPESTATUS[0]}
# Track if any build group failed
if [[ ${build_status} -ne 0 ]]; then
any_failed=1
fi
set -e
echo "::endgroup::" # End Bazel build group
end_ts=$(date +%s)
Expand All @@ -72,16 +138,36 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do
else
status_symbol="❌(${build_status})"
fi
echo "| ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} |" | tee -a "${SUMMARY_FILE}"

# Get commit hash/version for this group (group name is the module name)
commit_hash=$(get_commit_hash "${group}" "${KNOWN_GOOD_FILE}")
repo=$(get_module_repo "${group}" "${KNOWN_GOOD_FILE}")

# Truncate commit hash for display (first 8 chars)
if [[ "${commit_hash}" != "N/A" ]] && [[ ${#commit_hash} -gt 8 ]]; then
commit_hash_display="${commit_hash:0:8}"
else
commit_hash_display="${commit_hash}"
fi

# Only add link if KNOWN_GOOD_FILE is set
if [[ -n "${KNOWN_GOOD_FILE}" ]]; then
commit_version_cell="[${commit_hash_display}](${repo}/tree/${commit_hash})"
else
commit_version_cell="${commit_hash_display}"
fi

echo "| ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} | ${commit_version_cell} |" | tee -a "${SUMMARY_FILE}"
done

# Append aggregate totals row to summary table
echo "| TOTAL | | | ${overall_warn_total} | ${overall_depr_total} |" >> "${SUMMARY_FILE}"

# Display the full build summary explicitly at the end
echo "| TOTAL | | | ${overall_warn_total} | ${overall_depr_total} | |" >> "${SUMMARY_FILE}"# Display the full build summary explicitly at the end
echo '::group::Build Summary'
echo '=== Build Summary (echo) ==='
cat "${SUMMARY_FILE}" || echo "(Could not read summary file ${SUMMARY_FILE})"
echo '::endgroup::'

exit 0
# Report to GitHub Actions if any build group failed
if [[ ${any_failed} -eq 1 ]]; then
echo "::error::One or more build groups failed. See summary above."
fi
51 changes: 51 additions & 0 deletions known_good.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"timestamp": "2025-08-13T12:55:10Z",
"modules": {
"score_baselibs": {
"version": "0.1.3",
"repo": "https://github.com/eclipse-score/baselibs.git",
"patches": [
"//:wait_free_stack_fix.patch"
]
},
"communication": {
"version": "0.1.1",
"repo": "https://github.com/eclipse-score/communication.git"
},
"score_persistency": {
"version": "0.2.1",
"repo": "https://github.com/eclipse-score/persistency.git"
},
"score_orchestrator": {
"version": "0.0.3",
"repo": "https://github.com/eclipse-score/orchestrator.git"
},
"score_tooling": {
"version": "1.0.2",
"repo": "https://github.com/eclipse-score/tooling.git"
},
"score_platform": {
"hash": "a9cf44be1342f3c62111de2249eb3132f5ab88da",
"repo": "https://github.com/eclipse-score/score.git"
},
"score_bazel_platforms": {
"version": "0.0.2",
"repo": "https://github.com/eclipse-score/bazel_platforms.git"
},
"score_test_scenarios": {
"version": "0.3.0",
"repo": "https://github.com/eclipse-score/testing_tools.git"
},
"score_docs_as_code": {
"version": "2.0.1",
"repo": "https://github.com/eclipse-score/docs-as-code.git"
},
"score_process": {
"version": "1.3.1",
"repo": "https://github.com/eclipse-score/process_description.git"
}
},
"manifest_sha256": "4c9b7f...",
"suite": "full",
"duration_s": 742
}
51 changes: 51 additions & 0 deletions known_good.updated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"timestamp": "2025-11-13T10:12:42Z",
"modules": {
"score_baselibs": {
"repo": "https://github.com/eclipse-score/baselibs.git",
"hash": "edc4f8841c2210d11ef310049a78644ff3d039a3",
"patches": [
"//:wait_free_stack_fix.patch"
]
},
"communication": {
"repo": "https://github.com/eclipse-score/communication.git",
"hash": "ff40e5f1e90ce406b71c664cc6c8e902ab465305"
},
"score_persistency": {
"repo": "https://github.com/eclipse-score/persistency.git",
"hash": "7548876ed3e40ec3f3053c57634de68129287e05"
},
"score_orchestrator": {
"repo": "https://github.com/eclipse-score/orchestrator.git",
"hash": "7bb94ebae08805ea0a83dcc14f7c17da5ab927e6"
},
"score_tooling": {
"repo": "https://github.com/eclipse-score/tooling.git",
"hash": "654664dae7df2700fd5840c5ed6c07ac6c61705d"
},
"score_platform": {
"repo": "https://github.com/eclipse-score/score.git",
"hash": "4277c625daca11ef1fe16ffe7670498b354baa72"
},
"score_bazel_platforms": {
"repo": "https://github.com/eclipse-score/bazel_platforms.git",
"hash": "0115193f958e8e592168df1e29cf86174bdba761"
},
"score_test_scenarios": {
"repo": "https://github.com/eclipse-score/testing_tools.git",
"hash": "a2f9cded3deb636f5dc800bf7a47131487119721"
},
"score_docs_as_code": {
"repo": "https://github.com/eclipse-score/docs-as-code.git",
"hash": "1067fb67782389b50827f8637a74b1027ece52ee"
},
"score_process": {
"repo": "https://github.com/eclipse-score/process_description.git",
"hash": "e62e4c30808436e790590845f6c297cf605d7649"
}
},
"manifest_sha256": "4c9b7f...",
"suite": "full",
"duration_s": 742
}
Loading
Loading