Merge pull request #93 from conjure-cp/niklasdewally-patch-1 #12
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: "Documentation (Generate)" | |
on: | |
push: | |
branches: | |
- main # run for pushes to the main branch | |
workflow_dispatch: | |
jobs: | |
coverage: | |
name: "Generate Documentation" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
- name: Generate caching variables | |
id: cache-vars | |
run: | | |
echo -e "submodule_sha=$(./etc/ci/get_submodules_hash.sh)" >> "$GITHUB_OUTPUT" | |
echo -e "submodule_sha=$(./etc/ci/get_submodules_hash.sh)" | |
- 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: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index | |
~/.cargo/git/ | |
target/ | |
solvers/minion/vendor | |
solvers/chuffed/vendor | |
key: stable-${{ runner.os }}-gitmodules-${{ steps.cache-vars.outputs.submodule_sha }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: stable-${{ runner.os }}-gitmodules- | |
- name: Install rust stable | |
run: rustup update stable && rustup default stable | |
- name: Generate documentation | |
working-directory: . | |
run: | | |
./etc/scripts/gen_docs.sh | |
- name: Move all html to correct folders for deployment | |
run: | | |
mkdir deploy | |
cp -r target/doc/* deploy | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docs-${{ steps.sha.outputs.sha }} | |
path: deploy/** |