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
88 changes: 88 additions & 0 deletions .github/workflows/clang_tidy_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# *******************************************************************************
# Copyright (c) 2026 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: Clang-Tidy Analysis

on:
workflow_call:
inputs:
use_cache:
description: Whether to use Bazel disk cache.
required: false
type: boolean
default: true
outputs:
duration-seconds:
description: Runtime of the clang-tidy check in seconds.
value: ${{ jobs.clang_tidy.outputs.duration-seconds }}
workflow_dispatch:
inputs:
use_cache:
description: Whether to use Bazel disk cache.
required: false
type: boolean
default: true

permissions:
contents: read

concurrency:
group: clang_tidy_analysis-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
ANDROID_HOME: ""
ANDROID_SDK_ROOT: ""

jobs:
clang_tidy:
runs-on: ubuntu-24.04
outputs:
duration-seconds: ${{ steps.timer.outputs.duration-seconds }}
steps:
- name: Start timer
id: start_time
run: echo "start=$(date +%s)" >> "$GITHUB_OUTPUT"

- name: Checkout repository
uses: actions/checkout@v6.0.2

- name: Free Disk Space (Ubuntu)
uses: eclipse-score/more-disk-space@v1
with:
level: 4

- uses: castler/setup-bazel@8818d35864b4088fb3a12e7a3191777dc418fd69
with:
bazelisk-cache: true
disk-cache: "clang_tidy_analysis"
disk-cache-key: "main"
repository-cache: true
cache-save: ${{ github.ref == 'refs/heads/main' && (inputs.use_cache == true || inputs.use_cache == '') }}

- name: Allow linux-sandbox
uses: ./actions/unblock_user_namespace_for_linux_sandbox

- name: Run clang-tidy analysis
run: |
bazel build //... --aspects=//:tools/lint/linters.bzl%clang_tidy_aspect ${{ (inputs.use_cache == false) && '--disk_cache=' || '' }}

- name: End timer
if: ${{ always() }}
id: timer
run: |
end=$(date +%s)
start=${{ steps.start_time.outputs.start }}
duration=$((end - start))
echo "duration-seconds=$duration" >> "$GITHUB_OUTPUT"
echo "clang-tidy duration: ${duration}s" >> "$GITHUB_STEP_SUMMARY"
29 changes: 27 additions & 2 deletions .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ name: Coverage Report

on:
workflow_call:
inputs:
use_cache:
description: Whether to use Bazel disk cache.
required: false
type: boolean
default: true
outputs:
artifact-name:
description: 'Name of the coverage report artifact'
value: ${{ jobs.coverage_report.outputs.artifact-name }}
duration-seconds:
description: Runtime of the coverage check in seconds.
value: ${{ jobs.coverage_report.outputs.duration-seconds }}

permissions:
contents: read
Expand All @@ -33,8 +42,13 @@ jobs:
runs-on: ubuntu-24.04
outputs:
artifact-name: ${{ steps.set-artifact-name.outputs.artifact-name }}
duration-seconds: ${{ steps.timer.outputs.duration-seconds }}

steps:
- name: Start timer
id: start_time
run: echo "start=$(date +%s)" >> "$GITHUB_OUTPUT"

- name: Checkout Repository
uses: actions/checkout@v6.0.2

Expand All @@ -53,15 +67,16 @@ jobs:
with:
bazelisk-cache: true
disk-cache: "coverage_report"
disk-cache-key: "main"
repository-cache: true
cache-save: ${{ github.event_name == 'merge_group' }}
cache-save: ${{ github.ref == 'refs/heads/main' && (inputs.use_cache == true || inputs.use_cache == '') }}

- name: Allow linux-sandbox
uses: ./actions/unblock_user_namespace_for_linux_sandbox

- name: Run Unit Test with Coverage for C++
run: |
bazel coverage //... --build_tests_only
bazel coverage //... --build_tests_only ${{ (inputs.use_cache == false) && '--disk_cache=' || '' }}

- name: Generate HTML Coverage Report
# FIXME: "--ignore-errors category,inconsistent" is a workaround to cope with gcov messing up hit counts because of internal data races
Expand Down Expand Up @@ -93,4 +108,14 @@ jobs:
name: ${{ steps.set-artifact-name.outputs.artifact-name }}
path: ${{ github.event.repository.name }}_coverage_report_${{ github.sha }}.zip

- name: End timer
if: ${{ always() }}
id: timer
run: |
end=$(date +%s)
start=${{ steps.start_time.outputs.start }}
duration=$((end - start))
echo "duration-seconds=$duration" >> "$GITHUB_OUTPUT"
echo "Coverage duration: ${duration}s" >> "$GITHUB_STEP_SUMMARY"


142 changes: 142 additions & 0 deletions .github/workflows/hybrid_quality_demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# *******************************************************************************
# Copyright (c) 2026 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: Hybrid Quality Demo

on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
inputs:
run_nightly_checks:
description: Run nightly quality checks in addition to fast PR checks.
required: false
type: boolean
default: true
schedule:
- cron: '0 2 * * *'

permissions:
actions: write
contents: read

concurrency:
group: hybrid_quality_demo-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: false

jobs:
pr_checks:
name: Fast PR checks
uses: ./.github/workflows/build_and_test_host.yml
with:
run_all_configurations: false

coverage:
name: Coverage report (with cache)
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_nightly_checks == 'true') }}
needs: pr_checks
uses: ./.github/workflows/coverage_report.yml
with:
use_cache: true

coverage_no_cache:
name: Coverage report (no cache)
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_nightly_checks == 'true') }}
needs: pr_checks
uses: ./.github/workflows/coverage_report.yml
with:
use_cache: false

thread_sanitizer:
name: Thread sanitizer
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_nightly_checks == 'true') }}
needs: pr_checks
uses: ./.github/workflows/thread_sanitizer.yml

address_sanitizer:
name: Address/UB/leak sanitizer
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_nightly_checks == 'true') }}
needs: pr_checks
uses: ./.github/workflows/address_undefined_behavior_leak_sanitizer.yml

clang_tidy:
name: Clang-Tidy analysis (with cache)
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_nightly_checks == 'true') }}
needs: pr_checks
uses: ./.github/workflows/clang_tidy_analysis.yml
with:
use_cache: true

clang_tidy_no_cache:
name: Clang-Tidy analysis (no cache)
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_nightly_checks == 'true') }}
needs: pr_checks
uses: ./.github/workflows/clang_tidy_analysis.yml
with:
use_cache: false

dashboard:
name: Generate quality dashboard with timing
if: ${{ always() }}
needs:
- pr_checks
- coverage
- coverage_no_cache
- thread_sanitizer
- address_sanitizer
- clang_tidy
- clang_tidy_no_cache
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2

- name: Generate dashboard files with timing
env:
PR_CHECKS_RESULT: ${{ needs.pr_checks.result }}
COVERAGE_RESULT: ${{ needs.coverage.result || 'skipped' }}
COVERAGE_NO_CACHE_RESULT: ${{ needs.coverage_no_cache.result || 'skipped' }}
THREAD_SANITIZER_RESULT: ${{ needs.thread_sanitizer.result || 'skipped' }}
ADDRESS_SANITIZER_RESULT: ${{ needs.address_sanitizer.result || 'skipped' }}
CLANG_TIDY_RESULT: ${{ needs.clang_tidy.result || 'skipped' }}
CLANG_TIDY_NO_CACHE_RESULT: ${{ needs.clang_tidy_no_cache.result || 'skipped' }}
CLANG_TIDY_DURATION_SECONDS: ${{ needs.clang_tidy.outputs.duration-seconds || '' }}
CLANG_TIDY_NO_CACHE_DURATION_SECONDS: ${{ needs.clang_tidy_no_cache.outputs.duration-seconds || '' }}
COVERAGE_DURATION_SECONDS: ${{ needs.coverage.outputs.duration-seconds || '' }}
COVERAGE_NO_CACHE_DURATION_SECONDS: ${{ needs.coverage_no_cache.outputs.duration-seconds || '' }}
COVERAGE_ARTIFACT_NAME: ${{ needs.coverage.outputs.artifact-name }}
REPOSITORY_NAME: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
REF_NAME: ${{ github.ref_name }}
EVENT_NAME: ${{ github.event_name }}
run: |
python3 tools/ci/generate_hybrid_quality_dashboard.py dashboard

- name: Publish workflow summary
run: cat dashboard/summary.md >> "$GITHUB_STEP_SUMMARY"

- name: Show timing report
if: ${{ always() }}
run: |
echo "## Quality Check Timing Report" >> "$GITHUB_STEP_SUMMARY"
cat dashboard/timing.txt >> "$GITHUB_STEP_SUMMARY" 2>/dev/null || echo "Timing data generated." >> "$GITHUB_STEP_SUMMARY"

- name: Upload dashboard artifact
uses: actions/upload-artifact@v4
with:
name: hybrid_quality_dashboard_${{ github.run_id }}
path: dashboard/
Loading
Loading