WIP: arithmetic eprime operations #747
Workflow file for this run
This file contains 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: "Code and Documentation Coverage (PR)" | |
on: | |
pull_request: | |
paths: | |
- conjure_oxide/** | |
- solvers/** | |
- crates/** | |
- .github/actions/code-coverage.yml | |
workflow_dispatch: | |
env: | |
rust_release: nightly | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
SCCACHE_GHA_VERSION: 2 | |
jobs: | |
coverage: | |
name: "Generate Code Coverage Reports" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
- name: Get Sha | |
id: sha | |
run: | | |
if [[ ${{ github.event_name }} == 'pull_request' ]] | |
then | |
echo -e "sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT" | |
echo -e "sha=${{ github.event.pull_request.head.sha }}" | |
else | |
echo -e "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT" | |
echo -e "sha=${{ github.sha }}" | |
fi | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.3 | |
- 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: matrix.rust_release == 'nightly' | |
- uses: ./.github/actions/install-conjure | |
with: | |
os_arch: linux | |
version: 2.5.1 | |
- name: Generate coverage reports | |
run: | | |
./tools/coverage.sh | |
- name: Generate documentation coverage | |
run: | | |
RUSTDOCFLAGS='-Z unstable-options --show-coverage' cargo +nightly doc --workspace --no-deps > doc-coverage.txt | |
- name: Generate documentation coverage JSON | |
run: | | |
RUSTDOCFLAGS='-Z unstable-options --output-format json --show-coverage' cargo +nightly doc --workspace --no-deps > doc-coverage.json | |
- run: | | |
mkdir -p deploy/ | |
cp -r target/debug/coverage/* deploy/ # html | |
cp target/debug/lcov.info deploy/ # used for comments | |
cp doc-coverage.json deploy/ | |
cp doc-coverage.txt deploy/ | |
echo "${{github.event.pull_request.number}}" > deploy/prnumber | |
- name: Archive code coverage results for deployment | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-${{ steps.sha.outputs.sha }} | |
path: deploy/** | |