Repository navigation
65 lines (61 loc) · 2.31 KB
/
Copy pathprogress.yml
File metadata and controls
65 lines (61 loc) · 2.31 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
name: Progress checklist
# Regenerates plan/PROGRESS.md from plan/units/*.toml, main's difftest reports (CI
# artifact, scripts/fetch-reports.sh) and open "port: <unit id>" PRs, and commits it
# to main when it changed. PRs never edit PROGRESS.md themselves.
on:
push:
branches: [main]
paths:
- plan/units/**
- harness/plan/progress.py
- harness/plan/units.py
- harness/plan/test_progress.py
workflow_run: # main's CI uploaded fresh reports (case counts)
workflows: ["CI"]
types: [completed]
branches: [main]
pull_request_target:
types: [opened, reopened, closed, edited, ready_for_review, converted_to_draft]
schedule:
- cron: "17 * * * *"
workflow_dispatch:
permissions:
contents: write
pull-requests: read
actions: read # download main's difftest-reports artifact
concurrency:
group: progress
cancel-in-progress: false
jobs:
progress:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
# Always main: never check out or run PR code with a write token.
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 (pinned: this job has contents: write)
with:
ref: main
fetch-depth: 0 # fetch-reports.sh falls back to the last committed reports
- name: Test progress generator
run: python3 -m unittest discover -s harness/plan -p 'test_*.py'
- name: Fetch main's difftest reports
id: reports
env:
GH_TOKEN: ${{ github.token }}
run: |
if scripts/fetch-reports.sh; then echo "ok=true" >> "$GITHUB_OUTPUT"
else echo "No reports: keeping PROGRESS.md (case counts would be lost)."; fi
- name: Regenerate
if: steps.reports.outputs.ok == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: python3 harness/plan/progress.py --prs
- name: Commit if changed
if: steps.reports.outputs.ok == 'true'
run: |
if git diff --quiet -- plan/PROGRESS.md; then echo "unchanged"; exit 0; fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add plan/PROGRESS.md
git commit -m "plan/PROGRESS.md: regenerate [skip ci]"
git pull --rebase origin main
git push origin HEAD:main