Skip to content

Weekly Coverage

Weekly Coverage #9

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Weekly Coverage
on:
pull_request:
paths:
- .github/workflows/Coverage.yml
schedule:
# Runs every Monday at 06:00 UTC
- cron: '0 6 * * 1'
workflow_dispatch: # Allow manual trigger
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
coverage:
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
hypervisor: [kvm]
cpu: [amd]
runs-on: ${{ fromJson(
format('["self-hosted", "Linux", "X64", "1ES.Pool=hld-{0}-{1}"]',
matrix.hypervisor,
matrix.cpu)) }}
steps:
- uses: actions/checkout@v6
- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fix cargo home permissions
run: |
sudo chown -R $(id -u):$(id -g) /opt/cargo || true
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-debug"
cache-on-failure: "true"
- name: Build guest binaries
run: just guests
- name: Install nightly toolchain
run: |
rustup toolchain install nightly
rustup component add llvm-tools --toolchain nightly
- name: Generate coverage report
run: just coverage-ci ${{ matrix.hypervisor }}
- name: Coverage summary
run: |
echo '## Code Coverage Report' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
if [ -f target/coverage/summary.txt ]; then
echo '```' >> $GITHUB_STEP_SUMMARY
cat target/coverage/summary.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
else
echo 'Coverage report was not generated.' >> $GITHUB_STEP_SUMMARY
fi
echo '' >> $GITHUB_STEP_SUMMARY
echo '> For a detailed per-file breakdown, download the **HTML coverage report** from the Artifacts section below.' >> $GITHUB_STEP_SUMMARY
- name: Upload HTML coverage report
uses: actions/upload-artifact@v7
with:
name: coverage-html-${{ matrix.hypervisor }}-${{ matrix.cpu }}
path: target/coverage/html/
if-no-files-found: error
- name: Upload LCOV coverage report
uses: actions/upload-artifact@v7
with:
name: coverage-lcov-${{ matrix.hypervisor }}-${{ matrix.cpu }}
path: target/coverage/lcov.info
if-no-files-found: error
notify-failure:
runs-on: ubuntu-latest
needs: [coverage]
if: always() && needs.coverage.result == 'failure'
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Notify Coverage Failure
run: ./dev/notify-ci-failure.sh --title="Weekly Coverage Failure - ${{ github.run_number }}" --labels="area/ci-periodics,area/testing,lifecycle/needs-review"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}