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
18 changes: 16 additions & 2 deletions .github/workflows/cppreportcard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ jobs:
build/report/compile_commands.json build/report-consumer/compile_commands.json \
build/report-l6/compile_commands.json
python3 -m unittest discover -s validation -p 'test_quality_tools.py'
- name: Prepare analyzer timing
id: timing
run: |
python3 validation/report_timing.py prepare --config .cppreportcard.json --directory build/report-timing
- name: Generate complete quality report
if: ${{ !cancelled() && steps.inputs.outcome == 'success' }}
if: ${{ !cancelled() && steps.inputs.outcome == 'success' && steps.timing.outcome == 'success' }}
uses: soulteary/cppreportcard-action@8de72292324308064276a8feca167d543828d218 # v1.0.4
env:
REPORT_TIMING_DIR: ${{ github.workspace }}/build/report-timing
with:
mode: full
config: .cppreportcard.json
config: build/report-timing/config.json
compile_commands: build/report-compile-commands.json
output_dir: .github/cppreportcard
install_tools: 'false'
Expand All @@ -71,6 +77,11 @@ jobs:
commit: 'false'
- name: Require complete A+ analysis with zero diagnostics
run: python3 validation/check_report_complete.py .github/cppreportcard/report.json --require-aplus
- name: Summarize analyzer timings
if: ${{ always() && steps.timing.outcome == 'success' }}
run: |
python3 validation/report_timing.py summarize --directory build/report-timing \
--report .github/cppreportcard/report.json --output .github/cppreportcard/timing
- name: Upload report and compilation scope
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand All @@ -83,3 +94,6 @@ jobs:
.github/cppreportcard/report.md
.github/cppreportcard/badge.svg
build/report-compile-commands.json
.github/cppreportcard/timing.json
.github/cppreportcard/timing.md
build/report-timing/records/
136 changes: 103 additions & 33 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
for row in targets['windows']:
arm = row['arch'] == 'ARM64'
row.update(runner='windows-11-vs2026-arm' if arm else 'windows-2022',
generator='Visual Studio 18 2026' if arm else 'Visual Studio 17 2022',
cmake='4.2.3' if arm else '3.31.8',
cmake_arch='arm64' if arm else 'x86_64')
with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
Expand Down Expand Up @@ -103,39 +102,76 @@ jobs:
ref: ${{ env.COMM_SHA }}
path: linkerbot-transport-cpp
token: ${{ secrets.LINKERBOT_COMM_TOKEN || github.token }}
- name: Pull native distribution image
- name: Prepare native distribution and build tools
id: native
env:
UBUNTU: ${{ matrix.ubuntu }}
EXPECTED_ARCH: ${{ matrix.arch }}
run: |
docker pull "ubuntu:$UBUNTU"
docker image inspect "ubuntu:$UBUNTU" --format '{{index .RepoDigests 0}}' > "$RUNNER_TEMP/build-image.txt"
mkdir -p "$RUNNER_TEMP/release"
mkdir -p "$RUNNER_TEMP/release" "$RUNNER_TEMP/ccache" "$RUNNER_TEMP/catch2-install"
docker run -d --name linkerbot-release \
-v "$GITHUB_WORKSPACE:/src" -v "$RUNNER_TEMP/release:/release" \
-v "$RUNNER_TEMP/ccache:/cache/ccache" -v "$RUNNER_TEMP/catch2-install:/cache/catch2-install" \
-w /src -e HAND_SHA -e COMM_SHA -e RELEASE_VERSION -e EXPECTED_ARCH \
-e BUILD_IMAGE="$(cat "$RUNNER_TEMP/build-image.txt")" \
-e PATH=/opt/release-tools/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
-e CCACHE_DIR=/cache/ccache -e CCACHE_BASEDIR=/src -e CCACHE_COMPILERCHECK=content \
-e CCACHE_MAXSIZE=1G -e CMAKE_BUILD_PARALLEL_LEVEL=4 \
"$(cat "$RUNNER_TEMP/build-image.txt")" sleep infinity
docker exec linkerbot-release bash hand-cpp/validation/setup_linux_build.sh
echo "image=$(sha256sum "$RUNNER_TEMP/build-image.txt" | cut -d ' ' -f 1)" >> "$GITHUB_OUTPUT"
echo "toolchain=$(cat "$RUNNER_TEMP/release/toolchain-id")" >> "$GITHUB_OUTPUT"
- name: Restore compiler outputs
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}/ccache
key: linux-ccache-v1-${{ matrix.distribution }}-${{ matrix.arch }}-Release-${{ steps.native.outputs.image }}-${{ steps.native.outputs.toolchain }}-${{ hashFiles('hand-cpp/validation/build_support.py') }}-${{ env.HAND_SHA }}
restore-keys: |
linux-ccache-v1-${{ matrix.distribution }}-${{ matrix.arch }}-Release-${{ steps.native.outputs.image }}-${{ steps.native.outputs.toolchain }}-${{ hashFiles('hand-cpp/validation/build_support.py') }}-
- name: Restore shared Catch2 installation
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}/catch2-install
key: linux-catch2-v1-${{ matrix.distribution }}-${{ matrix.arch }}-Release-${{ steps.native.outputs.image }}-${{ steps.native.outputs.toolchain }}-${{ hashFiles('hand-cpp/validation/prepare_catch2.py', 'hand-cpp/validation/build_support.py', 'hand-cpp/validation/setup_linux_build.sh') }}
- name: Prepare one Catch2 for transport and hand tests
run: |
docker exec linkerbot-release ccache --zero-stats
docker exec linkerbot-release bash -euc '
export LINKERBOT_CI_TOOLCHAIN="$(cat /release/toolchain-id)"
python hand-cpp/validation/prepare_catch2.py \
--prefix /cache/catch2-install --work-dir /release/catch2-build \
--config Release --jobs 4 --generator Ninja --compiler-cache ccache
'
- name: Build, test, package and relocate inside target userspace
env:
EXPECTED_ARCH: ${{ matrix.arch }}
EXPECTED_DISTRIBUTION: ${{ matrix.distribution }}
run: |
docker run --rm -v "$GITHUB_WORKSPACE:/src" -v "$RUNNER_TEMP/release:/release" -w /src \
-e HAND_SHA -e COMM_SHA -e RELEASE_VERSION -e EXPECTED_ARCH -e EXPECTED_DISTRIBUTION \
-e BUILD_IMAGE="$(cat "$RUNNER_TEMP/build-image.txt")" \
"$(cat "$RUNNER_TEMP/build-image.txt")" bash -euc '
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends build-essential git ca-certificates python3 python3-venv ninja-build
test "$(uname -m)" = "$EXPECTED_ARCH"
python3 -m venv /opt/release-tools
/opt/release-tools/bin/pip install cmake==3.31.10
export PATH=/opt/release-tools/bin:$PATH
git config --global --add safe.directory /src/hand-cpp
git config --global --add safe.directory /src/linkerbot-transport-cpp
python hand-cpp/validation/run_release_validation.py \
--comm-source linkerbot-transport-cpp --work-dir /release \
--hand-sha "$HAND_SHA" --comm-sha "$COMM_SHA" \
--expected-version "$RELEASE_VERSION" --package-format TGZ \
--expected-arch "$EXPECTED_ARCH" --expected-distribution "$EXPECTED_DISTRIBUTION" \
--build-image "$BUILD_IMAGE" \
--config Release --suite all --require-slcan --allow-downloads --jobs 4
'
docker exec -e EXPECTED_DISTRIBUTION linkerbot-release bash -euc '
python hand-cpp/validation/run_release_validation.py \
--comm-source linkerbot-transport-cpp --work-dir /release \
--hand-sha "$HAND_SHA" --comm-sha "$COMM_SHA" \
--expected-version "$RELEASE_VERSION" --package-format TGZ \
--expected-arch "$EXPECTED_ARCH" --expected-distribution "$EXPECTED_DISTRIBUTION" \
--build-image "$BUILD_IMAGE" \
--config Release --suite all --require-slcan --allow-downloads --jobs 4 \
--catch2-dir /cache/catch2-install/lib/cmake/Catch2 --generator Ninja --compiler-cache ccache
'
- name: Record compiler cache statistics
if: always()
run: |
mkdir -p "$RUNNER_TEMP/release/evidence"
if docker exec linkerbot-release sh -c 'command -v ccache' >/dev/null 2>&1; then
docker exec linkerbot-release sh -c 'ccache --show-stats > /release/evidence/ccache-stats.txt'
docker exec linkerbot-release chmod -R a+rX /cache/ccache /cache/catch2-install /release/evidence
fi
- name: Remove build container
if: always()
run: |
if docker container inspect linkerbot-release >/dev/null 2>&1; then
docker rm -f linkerbot-release
fi
- name: Upload diagnostic evidence
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand Down Expand Up @@ -168,6 +204,12 @@ jobs:
HAND_SHA: ${{ needs.targets.outputs.hand_sha }}
COMM_SHA: ${{ needs.targets.outputs.comm_sha }}
RELEASE_VERSION: ${{ needs.targets.outputs.version }}
# Ninja parallelizes files within the large tests target. VS generators
# ignore compiler launchers, so use the native MSVC environment below.
CMAKE_GENERATOR: Ninja
CMAKE_BUILD_PARALLEL_LEVEL: '4'
SCCACHE_CACHE_SIZE: 1G
SCCACHE_IGNORE_SERVER_IO_ERROR: '1'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -181,10 +223,31 @@ jobs:
token: ${{ secrets.LINKERBOT_COMM_TOKEN || github.token }}
- name: Install native CMake
run: ./hand-cpp/validation/setup_windows.ps1 -Version '${{ matrix.cmake }}' -Architecture '${{ matrix.cmake_arch }}'
- name: Require native runner architecture
- name: Initialize native MSVC and Ninja
id: native
run: ./hand-cpp/validation/setup_windows_build.ps1 -Architecture '${{ matrix.arch }}'
- name: Install compiler cache
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: v0.19.0
- name: Restore compiler outputs
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}/sccache
key: windows-sccache-v1-${{ matrix.arch }}-${{ matrix.configuration }}-${{ steps.native.outputs.toolchain }}-${{ hashFiles('hand-cpp/validation/build_support.py') }}-${{ env.HAND_SHA }}
restore-keys: |
windows-sccache-v1-${{ matrix.arch }}-${{ matrix.configuration }}-${{ steps.native.outputs.toolchain }}-${{ hashFiles('hand-cpp/validation/build_support.py') }}-
- name: Restore shared Catch2 installation
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}/catch2-install
key: windows-catch2-v1-${{ matrix.arch }}-${{ matrix.configuration }}-${{ steps.native.outputs.toolchain }}-cmake${{ matrix.cmake }}-${{ hashFiles('hand-cpp/validation/prepare_catch2.py', 'hand-cpp/validation/build_support.py', 'hand-cpp/validation/setup_windows_build.ps1') }}
- name: Prepare one Catch2 for transport and hand tests
run: |
$Expected = if ('${{ matrix.arch }}' -eq 'ARM64') { 'Arm64' } else { 'X64' }
if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString() -ne $Expected) { throw 'Native runner architecture mismatch' }
python hand-cpp/validation/prepare_catch2.py `
--prefix "$env:RUNNER_TEMP/catch2-install" --work-dir "$env:RUNNER_TEMP/catch2-build" `
--config '${{ matrix.configuration }}' --jobs 4 --generator Ninja --compiler-cache sccache
if ($LASTEXITCODE -ne 0) { throw 'Catch2 preparation failed' }
- name: Build, test, package and relocate Windows SDK
run: |
python hand-cpp/validation/run_release_validation.py `
Expand All @@ -193,8 +256,15 @@ jobs:
--expected-version $env:RELEASE_VERSION --package-format ZIP `
--expected-arch '${{ matrix.arch }}' --expected-distribution Windows `
--config '${{ matrix.configuration }}' --suite all --require-slcan --allow-downloads --jobs 4 `
--generator '${{ matrix.generator }}' --architecture '${{ matrix.arch }}' --toolset 'v143,version=14.44'
--catch2-dir "$env:RUNNER_TEMP/catch2-install/lib/cmake/Catch2" --generator Ninja --compiler-cache sccache
if ($LASTEXITCODE -ne 0) { throw 'Windows release acceptance failed' }
- name: Record compiler cache statistics
if: always()
run: |
New-Item -ItemType Directory -Force "$env:RUNNER_TEMP/release/evidence" | Out-Null
if (Get-Command sccache -ErrorAction SilentlyContinue) {
sccache --show-stats | Tee-Object -FilePath "$env:RUNNER_TEMP/release/evidence/sccache-stats.txt"
}
- name: Upload diagnostic evidence
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand All @@ -211,7 +281,7 @@ jobs:
${{ runner.temp }}/release/packages/hand/*.sha256

collect:
name: Verify complete twelve-package release set
name: Verify complete ten-package release set
needs: [targets, linux, windows]
runs-on: ubuntu-24.04
steps:
Expand All @@ -231,9 +301,9 @@ jobs:
run: |
python3 validation/release_matrix.py release-assets \
--version "$VERSION" --hand-sha "$HAND_SHA" --comm-sha "$COMM_SHA"
cd release-assets
sha256sum --check SHA256SUMS.txt
test "$(find . -maxdepth 1 -type f | wc -l)" -eq 26
(cd release-assets && sha256sum --check SHA256SUMS.txt)
expected=$(python3 -c 'import sys; sys.path.insert(0,"validation"); from release_matrix import load_targets; t=load_targets("ci/package-targets.json"); print(2*(len(t["linux"])+len(t["windows"]))+2)')
test "$(find release-assets -maxdepth 1 -type f | wc -l)" -eq "$expected"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-assets
Expand Down
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To reuse a prebuilt transport v0.3.4 SDK, configure with
`cmake --preset prebuilt -DLINKERBOT_COMM_PREBUILT_PREFIX=/absolute/path/to/comm-sdk`.
See the [build guide](docs/en/guides/validation.md) for source/prebuilt modes, archive verification and downstream paths.

Release target types follow transport: eight Ubuntu Release SDKs and four Windows x64/ARM64 Debug/Release SDKs. See [release artifacts](docs/en/guides/releases.md).
The release workflow builds eight Ubuntu Release SDKs and two Windows x64/ARM64 Release SDKs. See [release artifacts](docs/en/guides/releases.md).

### 2. Connect the CAN bus

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To reuse a prebuilt transport v0.3.4 SDK, configure with
`cmake --preset prebuilt -DLINKERBOT_COMM_PREBUILT_PREFIX=/absolute/path/to/comm-sdk`.
See the [build guide](docs/en/guides/validation.md) for source/prebuilt modes, archive verification and downstream paths.

Release target types follow transport: eight Ubuntu Release SDKs and four Windows x64/ARM64 Debug/Release SDKs. See [release artifacts](docs/en/guides/releases.md).
The release workflow builds eight Ubuntu Release SDKs and two Windows x64/ARM64 Release SDKs. See [release artifacts](docs/en/guides/releases.md).

### 2. Connect the CAN bus

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ hand SDK 0.3.12 的源码、预构建及安装消费者均要求 transport 0.3.x
使用 `cmake --preset prebuilt -DLINKERBOT_COMM_PREBUILT_PREFIX=/absolute/path/to/comm-sdk`。
源码与预构建两种方式、下载校验及下游路径见[构建指南](docs/zh/guides/validation.md)。

发布目标类型与 transport 对齐:八份 Ubuntu Release SDK 和四份 Windows x64/ARM64 Debug/Release SDK,见[发布产物与校验](docs/zh/guides/releases.md)。
发布工作流构建八份 Ubuntu Release SDK 和两份 Windows x64/ARM64 Release SDK,见[发布产物与校验](docs/zh/guides/releases.md)。

### 2. 连接 CAN 总线

Expand Down
12 changes: 0 additions & 12 deletions ci/package-targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,12 @@
}
],
"windows": [
{
"arch": "x64",
"configuration": "Debug",
"runtime": "MDd",
"toolset": "143"
},
{
"arch": "x64",
"configuration": "Release",
"runtime": "MD",
"toolset": "143"
},
{
"arch": "ARM64",
"configuration": "Debug",
"runtime": "MDd",
"toolset": "143"
},
{
"arch": "ARM64",
"configuration": "Release",
Expand Down
8 changes: 8 additions & 0 deletions docs/en/guides/quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ The numeric score does not measure test coverage or hardware compatibility.

Every run uploads `report.json`, `report.md`, `badge.svg` and the merged compilation
database as `cppreportcard-ubuntu-24.04-arm`. Reports are not automatically committed.
The Actions Summary and the same artifact also contain `timing.md`, `timing.json`
and raw per-invocation records: elapsed spans for each analyzer and the slowest 20
clang-tidy invocations. Different configurations of one file remain separate.
Summed call time includes overlapping calls and is neither CPU time nor job duration.
Version probes are excluded; Cppcheck is measured as one database invocation.
Incomplete calls or missing report coverage are labeled explicitly. Instrumentation
preserves analyzer arguments, output, exit status, four-way parallelism and timeouts;
analysis scope and the quality gate are unchanged.
The [report index](https://github.com/linker-bot/linkerbot-hand-cpp-sdk/blob/main/.github/cppreportcard/README.md) links to the workflow.

## Reproduce
Expand Down
Loading
Loading