Skip to content

Docs

Docs #5

name: Docs
on: workflow_dispatch
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
jobs:
build_and_deploy_doc:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
name: "Build documentation and deploy to Pages"
env:
llvm_version: 16
doc_output_path: target/doc/
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install PipeWire
run: sudo apt-get install -y pipewire libpipewire-0.3-dev libspa-0.2-dev pipewire-media-session- wireplumber
- name: Run PipeWire
run: systemctl --user --now enable wireplumber.service
- name: LLVM Cache Restore
id: llvm-cache-restore
uses: actions/cache/restore@v3
with:
path: ${{ runner.temp }}/llvm-${{ env.llvm_version }}
key: llvm-${{ env.llvm_version }}-${{ runner.os }}
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: ${{ env.llvm_version }}
directory: ${{ runner.temp }}/llvm-${{ env.llvm_version }}
cached: ${{ steps.llvm-cache-restore.outputs.cache-hit }}
- name: Save Cache
id: llvm-cache-save
uses: actions/cache/save@v3
if: ${{ !steps.llvm-cache-restore.outputs.cache-hit }}
with:
path: ${{ runner.temp }}/llvm-${{ env.llvm_version }}
key: llvm-${{ env.llvm_version }}-${{ runner.os }}
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Cargo Doc
uses: actions-rs/cargo@v1
env:
LIBCLANG_PATH: ${{ runner.temp }}/llvm-${{ env.llvm_version }}/lib
RUSTDOCFLAGS: --enable-index-page -Zunstable-options
with:
toolchain: nightly
command: doc
- name: Fix permissions
run: |
chmod -c -R +rX "${{ env.doc_output_path }}" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{ env.doc_output_path }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2