-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (73 loc) · 2.27 KB
/
docs.yml
File metadata and controls
90 lines (73 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Docs
on:
push:
branches: ["**"]
tags-ignore: ["**"] # tags are handled by release.yml
workflow_dispatch:
workflow_call:
# Permissions required by the deploy job (OIDC-based GitHub Pages deployment).
# The caller (release.yml) must grant at least these same permissions.
permissions:
contents: read
pages: write
id-token: write
# Only one Pages deployment at a time; do not cancel in-progress deployments.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup build environment
uses: ./.github/actions/setup-build-env
with:
extra-pip-packages: formal-ford2vitepress
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Fetch dependencies
if: hashFiles('**/.deps_config.ini') != ''
run: FoBiS.py fetch
- name: Run coverage analysis
id: cov
uses: ./.github/actions/run-coverage-analysis
- name: Generate coverage badge JSON
env:
PCT: ${{ steps.cov.outputs.pct }}
run: |
python3 - <<'EOF'
import os, json
pct = float(os.environ["PCT"])
color = "brightgreen" if pct >= 80 else "yellow" if pct >= 60 else "red"
badge = {"schemaVersion": 1, "label": "coverage", "message": f"{pct:.1f}%", "color": color}
with open("docs/public/coverage-badge.json", "w") as f:
json.dump(badge, f)
EOF
- name: Build documentation
env:
COVERAGE_PCT: ${{ steps.cov.outputs.pct }}
run: |
formal generate --mirror-sources --diagrams --project docs/ford.md --output docs/api
cd docs && npm ci && npm run docs:build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4