Use clippy pedantic #11
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 | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Rust toolchain | ||
# uncomment if using workspaces wth `enable-index-page` | ||
# uses: dtolnay/rust-toolchain@nightly | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt, rust-src, clippy | ||
- name: Build Documentation | ||
env: | ||
# Uncomment if using `enable-index-page` | ||
# RUSTUP_TOOLCHAIN: nightly | ||
# RUSTDOCFLAGS: -D warnings -Zunstable-options --enable-index-page | ||
RUSTDOCFLAGS: -D warnings | ||
run: | | ||
cargo doc \ | ||
--no-deps \ | ||
--document-private-items \ | ||
--all-features | ||
# --workspace | ||
# Workaround to redirect to subdir/index.html for **non-workspace** projects | ||
# https://dev.to/deciduously/prepare-your-rust-api-docs-for-github-pages-2n5i | ||
echo '<meta http-equiv="refresh" content="0; url={{ project-name }}">' > target/doc/index.html | ||
- name: Upload artifact to Pages | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: 'target/doc' | ||
deploy: | ||
if: github.ref == 'refs/heads/master' | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: {% raw %}${{ steps.deployment.outputs.page_url }}{% endraw %} | ||
steps: | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v2 | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |