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
107 changes: 107 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# *******************************************************************************
# 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: Release Verification

on:
release:
types: [created]

jobs:
archive-report:
runs-on: ubuntu-latest
permissions:
contents: write # required to upload release assets

steps:
- name: Checkout Repository
uses: actions/checkout@v4.2.2

- name: Install lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.15.0
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true

- name: Bazel info (discover paths)
id: bazel-info
run: |
echo "BAZEL_OUTPUT_BASE=$(bazel info output_base)" >> $GITHUB_ENV
echo "BAZEL_USER_ROOT=$(bazel info output_user_root)" >> $GITHUB_ENV
echo "BAZEL_REPO_CACHE=$(bazel info repository_cache)" >> $GITHUB_ENV
bazel info

- name: Cache Bazel output base
uses: actions/cache@v4
with:
path: |
${{ env.BAZEL_OUTPUT_BASE }}/action_cache
${{ env.BAZEL_OUTPUT_BASE }}/bazel-out
${{ env.BAZEL_OUTPUT_BASE }}/external
${{ env.BAZEL_OUTPUT_BASE }}/execroot
key: bazel-ob-v2-${{ runner.os }}-${{ hashFiles('.bazelversion', 'MODULE.bazel', 'MODULE.bazel.lock', '**/*.bzl', 'Cargo.lock') }}
restore-keys: |
bazel-ob-v2-${{ runner.os }}-

- name: Build via Bazel
run: |
echo "Running: bazel build //..."
bazel build //...

- name: Run Unit Tests via Bazel
run: |
echo "Running: bazel test //:unit_tests"
bazel test //:unit_tests

- name: Run Unit Test with Coverage for Rust
run: |
# Run tests
bazel coverage //:unit_tests \
--collect_code_coverage \
--combined_report=lcov \
--experimental_generate_llvm_lcov \
--nocache_test_results \
--nostamp
# Generate HTML report
genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" \
-o=rust_coverage \
--show-details \
--legend \
--function-coverage \
--branch-coverage

- name: Create archive of test report
run: |
mkdir -p artifacts
find bazel-testlogs/ -name 'test.xml' -print0 | xargs -0 -I{} cp --parents {} artifacts/
cp -r rust_coverage artifacts/
zip -r ${{ github.event.repository.name }}_coverage_report.zip artifacts/
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}_coverage_report.zip
path: ${{ github.event.repository.name }}_coverage_report.zip

- name: Upload release asset (attach ZIP to GitHub Release)
uses: softprops/action-gh-release@v2.5.0
with:
files: ${{ github.event.repository.name }}_coverage_report.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ exports_files([
"clippy.toml",
"MODULE.bazel",
])

test_suite(
name = "unit_tests",
tests = [
"//feo-logger:libfeo_logger_rust_test",
"//feo-time:libfeo_time_cc_test",
"//feo-time:libfeo_time_test",
"//logd:liblogd_test",
],
)
Loading