Merge pull request #101 from ozgurakgun/caches #16
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: | |
env: | |
rust_release: stable | |
jobs: | |
coverage: | |
name: "Generate Documentation" | |
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: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index | |
~/.cargo/git/ | |
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 }} | |
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }} | |
- 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/** |