forked from eclipse-score/feo
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 3.58 KB
/
release.yml
File metadata and controls
107 lines (94 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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 }}