Add repo command completed (#12) #18
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: π API Documentation | |
on: | |
push: | |
paths: | |
- '.github/workflows/api_documentation.yml' # Run when this workflow changes | |
- '**/src/**' | |
branches: [main] | |
workflow_dispatch: # Run when manually triggered | |
workflow_call: # Run when called by another workflow | |
jobs: | |
build_documentation_job: | |
name: π Build Documentation Job | |
if: | | |
!startsWith(github.event.head_commit.message, 'style:') | |
&& !startsWith(github.event.head_commit.message, 'style(') | |
&& !startsWith(github.event.head_commit.message, 'chore:') | |
&& !startsWith(github.event.head_commit.message, 'chore(') | |
strategy: | |
fail-fast: true | |
matrix: | |
platform: [linux] | |
cpu_architecture: [x86_64] | |
include: | |
- platform: linux | |
cicd_runner: ubuntu-latest | |
- compilation_target: x86_64-unknown-linux-gnu | |
cpu_architecture: x86_64 | |
platform: linux | |
toolchain: gnu | |
runs-on: ${{ matrix.cicd_runner }} | |
steps: | |
- name: βοΈ Install Ubuntu Dependencies Step | |
id: dependencies_install_step | |
if: ${{ matrix.compilation_target == 'x86_64-unknown-linux-gnu' }} | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libgtk-4-dev | |
version: 1.0 | |
- name: π Build Documentation Step | |
id: documentation_build_step | |
uses: pax-hub/rust-github-action@main | |
env: | |
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options" | |
with: | |
subcommand: doc | |
arguments: '--workspace --all-features --no-deps --document-private-items' | |
rust_release_channel: nightly | |
use_cross: false | |
compilation_target: ${{ matrix.compilation_target }} | |
- name: Fix Permissions Step | |
id: permissions_fix_step | |
run: | | |
chmod -c -R +rX "target/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: β¬ Upload Documentation Step | |
id: documentation_upload_step | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: target/doc | |
publish_documentation_job: | |
name: β Publish Documentation Job | |
if: github.ref == 'refs/heads/main' # Publish only while dealing with the main branch | |
needs: build_documentation_job | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment_step.outputs.page_url }} | |
steps: | |
- name: β Deploy to GitHub Pages Step | |
id: deployment_step | |
uses: actions/deploy-pages@v4 | |