diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 0424bd8..a86e4d2 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -46,7 +46,7 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install -y pkg-config libcairo2-dev + sudo apt-get install -y pkg-config libcairo2-dev lcov - name: Determine version id: version run: | @@ -63,6 +63,8 @@ jobs: fi - name: Build Sphinx documentation run: bazel build //bazel/rules/rules_score:rules_score_doc + - name: Generate combined coverage report + run: bazel run //coverage:combined_report -- --out-dir coverage-html - name: Prepare documentation output run: | BAZEL_BIN="$(bazel info bazel-bin)" @@ -77,6 +79,12 @@ jobs: cp -r "${HTML_DIR}/." docs_output/ chmod -R u+w docs_output/ + # Embed the combined coverage report at docs_output/coverage/ + if [[ -d coverage-html ]]; then + mkdir -p docs_output/coverage + cp -r coverage-html/. docs_output/coverage/ + fi + # Prevent Jekyll from ignoring _static directories touch docs_output/.nojekyll diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f33e06..8904e2d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,3 +57,25 @@ jobs: - name: Ensure correct dependency resolution run: | bazel mod deps --lockfile_mode=update + coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6.0.2 + - name: Setup Bazel with cache + uses: bazel-contrib/setup-bazel@0.19.0 + with: + disk-cache: true + repository-cache: true + bazelisk-cache: true + - name: Install lcov + run: | + sudo apt-get update + sudo apt-get install -y lcov + - name: Generate combined coverage report + run: bazel run //coverage:combined_report -- --out-dir coverage-html + - name: Upload coverage report artifact + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage-html/