Skip to content
name: SchemaCrawler Job to Generate mermaid Diagram
on: [push]
jobs:
schemacrawler-job:
runs-on: ubuntu-latest
name: SchemaCrawler Job to Generate mermaid Diagram
steps:
- id: checkout
name: Checkout repository
uses: actions/checkout@v4
- id: schemacrawler
name: Run SchemaCrawler Action with specified command-line
uses: schemacrawler/[email protected]
with:
entrypoint: /schemacrawler.sh
args: --server=sqlite --database=schemacrawler.sqlite --info-level=standard --command script --tables "Authors|Books|BookAuthors" --script-language python --script ./.github/scripts/mermaid.py --output-file mermaid-er.mmd --log-level CONFIG
env:
USER: user-possibly-from-secrets
PASSWORD: password-possibly-from-secrets
- id: generate-diagram
name: Generate mermaid diagram
run: |
# Generate mermaid diagram
npm install @mermaid-js/mermaid-cli
./node_modules/.bin/mmdc -i mermaid-er.mmd -o mermaid-er.png -s 3
- id: upload-mermaid-er
name: Upload SchemaCrawler mermaid diagram
uses: actions/upload-artifact@v4
with:
name: mermaid-er
path: mermaid-er.*
- id: check-success
name: Fail the entire job if SchemaCrawler mermaid diagram generation has failures
run: |
[ ${{ env.SC_EXIT_STATUS }} -eq 0 ] && echo "SchemaCrawler mermaid diagram generation succeeded" || echo "SchemaCrawler mermaid diagram generation failed"
[ ${{ env.SC_EXIT_STATUS }} -eq 0 ] || exit 1