-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkibi-badge.yml
More file actions
86 lines (79 loc) · 3.08 KB
/
Copy pathkibi-badge.yml
File metadata and controls
86 lines (79 loc) · 3.08 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
# Opt-out Kibi GitHub Pages workflow: badge only.
#
# Prefer kibi-report.yml so the badge links to the full report.
# Copy this file to .github/workflows/kibi-badge.yml only when you
# explicitly do not want to publish the HTML report.
# Manual step: Settings → Pages → Source → GitHub Actions
#
# Pull requests still generate the report (same snapshot and % proven)
# and upload it as a workflow artifact. Only the repository default
# branch (and manual workflow_dispatch) may deploy the canonical badge
# to GitHub Pages. Use the unprivileged pull_request event so untrusted
# PR code cannot inherit default-branch secrets or Pages write permissions.
#
# Package manager: this example uses npm (`cache: npm` and `npm ci`).
# For pnpm, Yarn, or Bun, change those two values; see
# https://github.com/Looted/kibi/blob/develop/docs/github-integration.md
name: Kibi requirement health
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
# GitHub Actions checkouts are detached. Kibi requires an exact branch
# identity, so this must be set before kibi sync and kibi report.
env:
KIBI_BRANCH: ${{ github.head_ref || github.ref_name }}
concurrency:
group: ${{ github.event_name == 'pull_request' && format('kibi-pr-report-{0}', github.event.number) || 'pages' }}
cancel-in-progress: false
jobs:
build-report:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
- name: Install SWI-Prolog
run: |
sudo apt-get update
sudo apt-get install -y swi-prolog
- run: npm ci
- run: npm exec -- kibi sync
- run: npm exec -- kibi report --output kibi-report
- name: Upload Kibi PR report
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v5
with:
name: kibi-pr-report
path: kibi-report
if-no-files-found: error
- name: Keep only the namespaced badge for Pages
if: ${{ github.event_name != 'pull_request' }}
run: |
mkdir -p pages/kibi-report
cp kibi-report/badge.svg pages/kibi-report/badge.svg
- uses: actions/configure-pages@v6
if: ${{ github.event_name != 'pull_request' }}
- uses: actions/upload-pages-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
path: pages
deploy-report:
needs: build-report
if: ${{ github.event_name != 'pull_request' && (github.event_name == 'workflow_dispatch' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)) }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy requirement-health badge
id: deployment
uses: actions/deploy-pages@v5