Skip to content

chore(config): make sample configs Keystone templates (#139) #603

chore(config): make sample configs Keystone templates (#139)

chore(config): make sample configs Keystone templates (#139) #603

Workflow file for this run

# =============================================================================
# CI Orchestrator Workflow for Axon
# =============================================================================
# Main entry point that orchestrates the full CI pipeline.
#
# Coverage Collection Strategy:
# - Each workflow uploads coverage directly with flags (cpp-unit, cpp-integration, ros-*, e2e-*)
# - Codecov automatically merges multiple uploads from the same commit
# - No local merge step needed - simpler and faster
#
# Pipeline Diagram:
#
# ┌─────────────────────────────────────────────────┐
# │ Stage 1: C++ Unit Tests │
# │ ┌───────────────────────────────────────────┐ │
# │ │ C++ Unit Tests +cov artifacts │ │
# │ └───────────────────┬───────────────────────┘ │
# └─────────────────────┼───────────────────────────┘
# │
# ┌───────────────┼───────────────┐
# │ │ │
# ▼ ▼ ▼
# ┌───────────────┐ ┌───────────────┐
# │ Build Images │ │ C++ Integr. │
# │ (shared, │ │ Tests +cov │
# │ 3 distros) │ │ │
# └───────┬───────┘ └───────────────┘
# │
# ┌────┴────┐
# │ │
# ▼ ▼
# ┌──────────┐ ┌──────────┐
# │ ROS Tests │ │ E2E │
# │ (unit+ │ │ Tests │
# │ integ.) │ │ +cov │
# │ +cov │ │ │
# └──────────┘ └──────────┘
# │ │
# └───────┬───────┘
# │
# ▼
# ┌───────────────┐
# │ Merge │ (Merge all coverage)
# │ Coverage │
# │ → Codecov │
# └───────────────┘
#
# =============================================================================
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
# Cancel in-progress runs when a new commit is pushed to the same branch
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
# Workflow-level permissions for nested workflows (docker-build.yml needs packages:write)
permissions:
contents: read
packages: write
jobs:
# ===========================================================================
# Stage 0: Format, Lint, and License Compliance (runs first)
# ===========================================================================
format-lint-reuse:
name: Format, Lint & License
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install clang-format-21
run: |
sudo apt-get update
sudo apt-get install -y lsb-release wget software-properties-common gnupg
. /etc/os-release
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/apt.llvm.org.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/apt.llvm.org.gpg] https://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-21 main" | \
sudo tee /etc/apt/sources.list.d/llvm-21.list >/dev/null
sudo apt-get update
sudo apt-get install -y clang-format-21
clang-format-21 --version
- name: Install Python CI tools
run: |
python -m pip install --upgrade pip
python -m pip install reuse gersemi
reuse --version
gersemi --version
- name: Run clang-format check
run: |
make format-ci
- name: Run REUSE compliance check
run: |
echo "Checking REUSE license compliance..."
reuse lint
echo "✓ REUSE compliance check passed!"
- name: Generate SPDX SBOM
run: |
reuse spdx --output reuse.spdx
echo "✓ SPDX SBOM generated successfully!"
- name: Upload SPDX SBOM
uses: actions/upload-artifact@v4
with:
name: spdx-sbom
path: reuse.spdx
retention-days: 90
# ===========================================================================
# Stage 1: Build Docker Images (shared for ROS and E2E tests)
# Builds all CI ROS distributions once, used by both tests-ros and e2e-tests
# ===========================================================================
build-images:
name: Build Images
needs: format-lint-reuse
uses: ./.github/workflows/docker-build.yml
secrets: inherit
# ===========================================================================
# Stage 1: C++ Unit Tests (runs first)
# ===========================================================================
unit-tests-cpp:
name: C++ Unit Tests
uses: ./.github/workflows/unit-tests-cpp.yml
secrets: inherit
# ===========================================================================
# Stage 1: Zenoh Plugin Tests (runs in parallel with C++ unit tests)
# Includes both unit tests and integration tests
# ===========================================================================
tests-zenoh:
name: Zenoh Plugin Tests
uses: ./.github/workflows/tests-zenoh.yml
secrets: inherit
# ===========================================================================
# Stage 2: ROS Tests and E2E Tests (run in parallel after unit tests)
# ROS tests include both unit and integration tests
# Note: These depend on build-images but only pull pre-built images
# ===========================================================================
tests-ros:
name: ROS Tests
needs: [unit-tests-cpp, build-images]
uses: ./.github/workflows/tests-ros.yml
secrets: inherit
e2e-tests:
name: E2E Tests
needs: [unit-tests-cpp, build-images]
uses: ./.github/workflows/e2e-tests.yml
secrets: inherit
# ===========================================================================
# Stage 2 (parallel): C++ Integration Tests (after C++ unit tests pass)
# Runs EdgeUploader integration tests with MinIO
# ===========================================================================
integration-tests-cpp:
name: C++ Integration Tests
needs: [unit-tests-cpp]
uses: ./.github/workflows/integration-tests-cpp.yml
secrets: inherit
# ===========================================================================
# Stage 2 (parallel): WebSocket RPC Client E2E Tests
# Tests the recorder connecting as a WebSocket client to a mock keystone
# ===========================================================================
ws-rpc-client-e2e-tests:
name: WS RPC Client E2E
needs: [unit-tests-cpp]
uses: ./.github/workflows/ws-rpc-client-e2e.yml
secrets: inherit
# ===========================================================================
# Stage 3: Merge All Coverage and Upload to Codecov
# Combines coverage from ROS tests, C++ tests (unit + integration), and E2E tests
# ===========================================================================
# Final Status Check
# ===========================================================================
ci-success:
name: CI Success
runs-on: ubuntu-latest
needs: [tests-ros, unit-tests-cpp, integration-tests-cpp, e2e-tests, tests-zenoh, ws-rpc-client-e2e-tests]
if: always()
steps:
- name: Check pipeline status
run: |
echo "ROS Tests: ${{ needs.tests-ros.result }}"
echo "C++ Unit Tests: ${{ needs.unit-tests-cpp.result }}"
echo "C++ Integration Tests: ${{ needs.integration-tests-cpp.result }}"
echo "E2E Tests: ${{ needs.e2e-tests.result }}"
echo "Zenoh Plugin Tests: ${{ needs.tests-zenoh.result }}"
echo "WS RPC Client E2E Tests: ${{ needs.ws-rpc-client-e2e-tests.result }}"
if [ "${{ needs.tests-ros.result }}" != "success" ]; then
echo "❌ ROS tests failed"
exit 1
fi
if [ "${{ needs.unit-tests-cpp.result }}" != "success" ]; then
echo "❌ C++ unit tests failed"
exit 1
fi
if [ "${{ needs.integration-tests-cpp.result }}" != "success" ]; then
echo "❌ C++ integration tests failed"
exit 1
fi
if [ "${{ needs.e2e-tests.result }}" != "success" ]; then
echo "❌ E2E tests failed"
exit 1
fi
if [ "${{ needs.tests-zenoh.result }}" != "success" ]; then
echo "❌ Zenoh plugin tests failed"
exit 1
fi
if [ "${{ needs.ws-rpc-client-e2e-tests.result }}" != "success" ]; then
echo "❌ WS RPC Client E2E tests failed"
exit 1
fi
echo "✅ CI pipeline completed successfully!"
echo ""
echo "📊 Coverage: Individual workflows upload with flags (cpp-unit, cpp-integration, ros-*, e2e-*, zenoh-plugin, ws-rpc-e2e)"
echo " Codecov automatically merges multiple uploads from the same commit."