ci: add architecture docs generation on master push
This commit is contained in:
49
.gitea/workflows/docs.yml
Normal file
49
.gitea/workflows/docs.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Architecture Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
generate:
|
||||
name: Generate diagrams
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Generate project diagram
|
||||
run: ./target/release/archlens . --level project --output docs/architecture/project.mmd
|
||||
|
||||
- name: Generate module diagram
|
||||
run: ./target/release/archlens . --level module --output docs/architecture/module.mmd
|
||||
|
||||
- name: Generate type diagrams (split)
|
||||
run: ./target/release/archlens . --level type --split-by-module --output docs/architecture/type/
|
||||
|
||||
- name: Commit if changed
|
||||
run: |
|
||||
git config user.name "Archlens Bot"
|
||||
git config user.email "archlens@noreply"
|
||||
git add docs/architecture/
|
||||
git diff --staged --quiet || git commit -m "docs: update architecture diagrams"
|
||||
git push || true
|
||||
Reference in New Issue
Block a user