Skip to content

Translation from Conjure-Oxide Model to CNF KissSAT #329

Translation from Conjure-Oxide Model to CNF KissSAT

Translation from Conjure-Oxide Model to CNF KissSAT #329

Workflow file for this run

name: "Code Coverage (Generate)"
on:
push:
branches:
- main # run for pushes to the main branch
paths:
- Cargo.*
- conjure-oxide/**
- solvers/**
- crates/**
- .github/actions/code-coverage.yml
pull_request:
paths:
- Cargo.*
- conjure-oxide/**
- solvers/**
- crates/**
- .github/actions/code-coverage.yml
workflow_dispatch:
env:
rust_release: nightly
jobs:
coverage:
name: "Generate Code Coverage Reports"
# only do coverage for ready PRs
if: ${{ github.event != 'pull_request' || ( github.event == 'pull_request' && (! github.event.pull_request.draft)) }}
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
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
solvers/minion/vendor
solvers/chuffed/vendor
key: ${{ runner.os }}-${{ env.rust_release }}-${{ github.event.repository.updated_at }}
restore-keys: ${{ runner.os }}-${{ env.rust_release }}
- name: Install rust ${{ env.rust_release }}
working-directory: ./solvers/minion
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}
- name: Generate coverage reports
working-directory: .
run: |
./tools/gen_coverage_all.sh
- name: Move all html to correct folders for deployment
run: |
# put things both in the sha directory, and in main/
mkdir -p deploy/conjure-oxide
mkdir -p deploy/minion
mkdir -p deploy/chuffed
cp -r conjure_oxide/coverage/html/* deploy/conjure-oxide
cp -r solvers/minion/coverage/html/* deploy/minion
cp -r solvers/chuffed/coverage/html/* deploy/chuffed
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-${{ steps.sha.outputs.sha }}
path: deploy/**
- name: Format summary
run : |
CONJURE_OXIDE_URL="https://conjure-cp.github.io/conjure-oxide/coverage/${{ steps.sha.outputs.sha }}/conjure-oxide"
MINION_URL="https://conjure-cp.github.io/conjure-oxide/coverage/${{ steps.sha.outputs.sha }}/minion"
CHUFFED_URL="https://conjure-cp.github.io/conjure-oxide/coverage/${{ steps.sha.outputs.sha }}/chuffed"
CONJURE_OXIDE_LATEST="https://conjure-cp.github.io/conjure-oxide/coverage/main/conjure-oxide"
MINION_LATEST="https://conjure-cp.github.io/conjure-oxide/coverage/main/minion"
CHUFFED_LATEST="https://conjure-cp.github.io/conjure-oxide/coverage/main/chuffed"
echo '# Code Coverage' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## This commit" >> $GITHUB_STEP_SUMMARY
echo "| Crate | | | " >> $GITHUB_STEP_SUMMARY
echo "| ----- | ----- | ----- |" >> $GITHUB_STEP_SUMMARY
echo "| Conjure-Oxide | ![](${CONJURE_OXIDE_URL}/badges/flat.svg) | [Full Report](${CONJURE_OXIDE_URL}) | " >> $GITHUB_STEP_SUMMARY
echo "| Minion | ![](${MINION_URL}/badges/flat.svg) | [Full Report](${MINION_URL}) | " >> $GITHUB_STEP_SUMMARY
echo "| Chuffed | ![](${CHUFFED_URL}/badges/flat.svg) | [Full Report](${CHUFFED_URL}) | " >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Main" >> $GITHUB_STEP_SUMMARY
echo "| Crate | | | " >> $GITHUB_STEP_SUMMARY
echo "| ----- | ----- | ----- |" >> $GITHUB_STEP_SUMMARY
echo "| Conjure-Oxide | ![](${CONJURE_OXIDE_LATEST}/badges/flat.svg) | [Full Report](${CONJURE_OXIDE_LATEST}) | " >> $GITHUB_STEP_SUMMARY
echo "| Minion | ![](${MINION_LATEST}/badges/flat.svg) | [Full Report](${MINION_LATEST}) | " >> $GITHUB_STEP_SUMMARY
echo "| Chuffed | ![](${CHUFFED_LATEST}/badges/flat.svg) | [Full Report](${CHUFFED_LATEST}) | " >> $GITHUB_STEP_SUMMARY