Skip to content

Merge pull request #595 from conjure-cp/nik/reapply-blocking-rule-tra… #233

Merge pull request #595 from conjure-cp/nik/reapply-blocking-rule-tra…

Merge pull request #595 from conjure-cp/nik/reapply-blocking-rule-tra… #233

name: "Code and Documentation Coverage (main)"
on:
push:
branches:
- main # run for pushes to the main branch
workflow_dispatch:
env:
rust_release: nightly
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_VERSION: 2
jobs:
doc-coverage:
name: "Documentation Coverage"
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install rust ${{ env.rust_release }}
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}
- name: Disable rust-lld (to fix linkme)
run: |
echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
echo RUSTDOCFLAGS=${RUSTDOCFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
if: env.rust_release == 'nightly'
- name: Install pandoc
uses: pandoc/actions/setup@v1
- name: Generate documentation coverage report
run: |
echo "# Documentation Coverage Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
./tools/ci/generate-doc-coverage-summary-md.bash >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Commit: [${{github.event.after}}](https://github.com/conjure-cp/conjure-oxide/commit/${{github.event.after}})" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
./tools/ci/generate-doc-coverage-report-md.bash >> $GITHUB_STEP_SUMMARY
- name: Generate summary
run: |
./tools/ci/generate-doc-coverage-summary-md.bash > main-doc-coverage-summary.txt
- name: Upload summary as artifact (for later use)
uses: actions/upload-artifact@v4
with:
name: main-doc-coverage-summary
path: main-doc-coverage-summary.txt
overwrite: true
coverage:
name: "Generate Code Coverage Reports"
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install rust ${{ env.rust_release }}
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}
- name: Disable rust-lld (to fix linkme)
run: |
echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
echo RUSTDOCFLAGS=${RUSTDOCFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
- uses: ./.github/actions/install-conjure
with:
os_arch: linux
version: 2.5.1
- name: Generate code coverage reports
run: |
./tools/coverage.sh
- run: |
mkdir -p deploy/
cp -r target/debug/coverage/* deploy/ # html
cp target/debug/lcov.info deploy/ # used for diffing code coverage in PR comments
- name: Copy coverage report to /main.
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./deploy
target-folder: "coverage/main"
branch: gh-pages
commit-message: "Actions: Update code coverage for main "