docs: add current Xquik OpenAPI example #782
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Coverage | |
| # Code coverage tracking with threshold enforcement | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: coverage-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run_coverage: ${{ steps.classify.outputs.run_coverage }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Detect changed files | |
| id: filter | |
| if: github.event_name == 'push' || github.event_name == 'pull_request' | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| rust: | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - 'build.rs' | |
| workflow: | |
| - '.github/workflows/coverage.yml' | |
| - name: Classify coverage scope | |
| id: classify | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| run_coverage=false | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ steps.filter.outputs.rust }}" == "true" || "${{ steps.filter.outputs.workflow }}" == "true" ]]; then | |
| run_coverage=true | |
| fi | |
| echo "run_coverage=${run_coverage}" >> "${GITHUB_OUTPUT}" | |
| fast-path: | |
| name: Fast Path (coverage skipped) | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.run_coverage != 'true' | |
| steps: | |
| - name: Skip coverage | |
| run: echo "No coverage-relevant changes detected; skipping coverage job." | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.run_coverage == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: coverage | |
| - name: Run tests once for coverage data | |
| run: cargo llvm-cov --all-features --workspace --no-report -- --test-threads=1 | |
| - name: Generate coverage JSON summary | |
| run: cargo llvm-cov report --json --summary-only --output-path coverage.json --ignore-filename-regex 'test_server/|bin/uxc-test-.*\.rs$' | |
| - name: Display coverage report | |
| run: | | |
| echo "=== Coverage Summary ===" | |
| cargo llvm-cov report --ignore-filename-regex 'test_server/|bin/uxc-test-.*\.rs$' | |
| - name: Check coverage threshold (65%) | |
| run: | | |
| echo "=== Checking Coverage Threshold ===" | |
| cargo llvm-cov report --ignore-filename-regex 'test_server/|bin/uxc-test-.*\.rs$' --fail-under-lines 65 | |
| echo "✅ Coverage meets minimum threshold of 65%" | |
| - name: Generate coverage HTML report | |
| run: cargo llvm-cov report --html --output-dir html --ignore-filename-regex 'test_server/|bin/uxc-test-.*\.rs$' | |
| - name: Upload coverage JSON report | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: coverage-json | |
| path: coverage.json | |
| retention-days: 30 | |
| - name: Upload coverage HTML report | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: coverage-html | |
| path: html/ | |
| retention-days: 30 | |
| - name: Coverage summary comment | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "=== Coverage Report Available ===" | |
| echo "HTML and JSON reports have been uploaded as artifacts." | |
| echo "Download them from the Actions run page to view detailed coverage information." |