-
Notifications
You must be signed in to change notification settings - Fork 5
Implement Diagnostic Fault Library with basic DFM, SOVD interface, and CI infrastructure #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
93b887a
6258d60
47a5f8c
b1a3419
487e7c5
a01e530
5152938
1e68114
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| build --java_language_version=17 | ||
| build --tool_java_language_version=17 | ||
| build --java_runtime_version=remotejdk_17 | ||
| build --tool_java_runtime_version=remotejdk_17 | ||
| build --@score-baselibs//score/json:base_library=nlohmann | ||
| build --@score-baselibs//score/mw/log/flags:KRemote_Logging=False | ||
|
|
||
| test --test_output=errors | ||
|
|
||
| common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ | ||
| common --registry=https://bcr.bazel.build | ||
|
|
||
| # allow empty globs for docs | ||
| build --noincompatible_disallow_empty_glob |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 8.3.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Bugfix | ||
|
|
||
| > [!IMPORTANT] | ||
| > Use this template only for bugfixes that do not influence topics covered by contribution requests or improvements. | ||
|
|
||
| > [!CAUTION] | ||
| > Make sure to submit your pull-request as **Draft** until you are ready to have it reviewed by the Committers. | ||
|
|
||
| ## Description | ||
|
|
||
| [A short description of the bug being fixed by the contribution.] | ||
|
|
||
| ## Related ticket | ||
|
|
||
| > [!IMPORTANT] | ||
| > Please replace `[ISSUE-NUMBER]` with the issue-number that tracks this bug fix. If there is no such | ||
| > ticket yet, create one via [this issue template](../ISSUE_TEMPLATE/new?template=bug_fix.md). | ||
|
|
||
| closes [ISSUE-NUMBER] (bugfix ticket) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Improvement | ||
|
|
||
| > [!IMPORTANT] | ||
| > Use this template only for improvement that do not influence topics covered by contribution requests or bug fixes. | ||
|
|
||
| > [!CAUTION] | ||
| > Make sure to submit your pull-request as **Draft** until you are ready to have it reviewed by the Committers. | ||
|
|
||
| ## Description | ||
|
|
||
| [A short description of the improvement being addressed by the contribution.] | ||
|
|
||
| ## Related ticket | ||
|
|
||
| > [!IMPORTANT] | ||
| > Please replace `[ISSUE-NUMBER]` with the issue-number that tracks this bug fix. If there is no such | ||
| > ticket yet, create one via [this issue template](../ISSUE_TEMPLATE/new?template=improvement.md). | ||
|
|
||
| closes [ISSUE-NUMBER] (improvement ticket) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # ******************************************************************************* | ||
| # 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: Security Audit | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| merge_group: | ||
| types: [checks_requested] | ||
| schedule: | ||
| # Run weekly on Monday at 06:00 UTC to catch newly disclosed advisories | ||
| - cron: "0 6 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| cargo-audit: | ||
| name: Cargo Audit | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install cargo-audit | ||
| uses: taiki-e/install-action@23db74cab27cd77071e076a00b569de9549cf0dd # v2.48.8 | ||
| with: | ||
| tool: cargo-audit@0.22.1 | ||
|
|
||
| - name: Run cargo audit | ||
| run: cargo audit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # ******************************************************************************* | ||
| # 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: Build & Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| merge_group: | ||
| types: [checks_requested] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| cargo-build-test: | ||
| name: Cargo Build & Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
|
||
| - name: Build all crates | ||
| run: cargo build --workspace | ||
|
|
||
| - name: Run tests (IPC tests run serially) | ||
| run: cargo test --workspace --all-targets | ||
|
|
||
| bazel-build-test: | ||
| name: Bazel Build & Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bazel | ||
| uses: bazel-contrib/setup-bazel@0.14.0 | ||
| with: | ||
| bazelisk-cache: true | ||
| disk-cache: ${{ github.workflow }}-bazel | ||
| repository-cache: true | ||
|
|
||
| - name: Bazel build (excluding docs — score_plantuml requires local runfiles) | ||
| run: bazel build //src/... //tests/... | ||
|
|
||
| - name: Bazel test (excluding docs) | ||
| run: bazel test //src/... //tests/... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # ******************************************************************************* | ||
| # 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: Copyright Check | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: lint, coverage and copyright are available in https://github.com/eclipse-opensovd/cicd-workflows which should be re-used and extended if possible, so we don't re-invent pipelines for all repos. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just saw that this is using bazel for copyright check. While I do get why bazel is used in the fault lib, I still believe it makes sense to align the CI approaches in opensovd. |
||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| merge_group: | ||
| types: [checks_requested] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| copyright: | ||
| name: Copyright Header Validation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bazel | ||
| uses: bazel-contrib/setup-bazel@0.14.0 | ||
| with: | ||
| bazelisk-cache: true | ||
| disk-cache: ${{ github.workflow }}-bazel | ||
| repository-cache: true | ||
|
|
||
| - name: Check copyright headers | ||
| run: bazel run //:copyright.check | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # ******************************************************************************* | ||
| # 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: Coverage | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| merge_group: | ||
| types: [checks_requested] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| COVERAGE_THRESHOLD: 90 | ||
|
|
||
| jobs: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: coverage isn't available in https://github.com/eclipse-opensovd/cicd-workflows yet. Would be great to move it there, so it can be shared among all repos. |
||
| coverage: | ||
| name: Code Coverage | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| components: llvm-tools-preview | ||
|
|
||
| - name: Install cargo-llvm-cov | ||
| uses: taiki-e/install-action@cargo-llvm-cov | ||
|
|
||
| - name: Generate coverage (LCOV) | ||
| run: cargo llvm-cov --workspace --exclude xtask --ignore-filename-regex 'test_utils|dfm_test_utils' --lcov --output-path lcov.info | ||
|
|
||
| - name: Generate coverage summary | ||
| id: coverage | ||
| run: | | ||
| # Extract total line coverage percentage from cargo-llvm-cov text output | ||
| REPORT=$(cargo llvm-cov --workspace --exclude xtask --ignore-filename-regex 'test_utils|dfm_test_utils' --no-run 2>&1) | ||
| echo "$REPORT" | ||
|
|
||
| # Parse the TOTAL line for line coverage | ||
| TOTAL_LINE_COV=$(echo "$REPORT" | grep '^TOTAL' | awk '{print $(NF-3)}' | tr -d '%') | ||
| echo "total_coverage=$TOTAL_LINE_COV" >> "$GITHUB_OUTPUT" | ||
| echo "### Coverage Report" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "**Total line coverage: ${TOTAL_LINE_COV}%**" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "" >> "$GITHUB_STEP_SUMMARY" | ||
| echo '```' >> "$GITHUB_STEP_SUMMARY" | ||
| echo "$REPORT" >> "$GITHUB_STEP_SUMMARY" | ||
| echo '```' >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Upload coverage artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-lcov | ||
| path: lcov.info | ||
| retention-days: 30 | ||
|
|
||
| - name: Enforce coverage threshold | ||
| run: | | ||
| COVERAGE="${{ steps.coverage.outputs.total_coverage }}" | ||
| THRESHOLD="${{ env.COVERAGE_THRESHOLD }}" | ||
| echo "Coverage: ${COVERAGE}%, Threshold: ${THRESHOLD}%" | ||
| if (( $(echo "$COVERAGE < $THRESHOLD" | bc -l) )); then | ||
| echo "::error::Coverage ${COVERAGE}% is below threshold ${THRESHOLD}%" | ||
| exit 1 | ||
| fi | ||
| echo "Coverage ${COVERAGE}% meets threshold ${THRESHOLD}%" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # ******************************************************************************* | ||
| # 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: Format Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| merge_group: | ||
| types: [checks_requested] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| rustfmt: | ||
| name: Rust Format (rustfmt) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| components: rustfmt | ||
|
|
||
| - name: Check formatting | ||
| run: cargo fmt --all -- --check | ||
|
|
||
| bazel-format: | ||
| name: Bazel Format Check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bazel | ||
| uses: bazel-contrib/setup-bazel@0.14.0 | ||
| with: | ||
| bazelisk-cache: true | ||
| disk-cache: ${{ github.workflow }}-bazel | ||
| repository-cache: true | ||
|
|
||
| - name: Check Bazel formatting | ||
| run: bazel test //:format.check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add
--lockedto all cargo commands which support it?This will speed up the build pipeline and allows for better reproducibility.