-
-
Notifications
You must be signed in to change notification settings - Fork 205
77 lines (74 loc) · 3.04 KB
/
Copy pathsettings-audit.yml
File metadata and controls
77 lines (74 loc) · 3.04 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
name: Settings audit
on:
pull_request:
paths:
- 'src/settings*.qml'
- 'src/settings-catalog.json'
- 'scripts/settings_audit.py'
- 'scripts/phase2_catalog_migration.py'
- 'scripts/phase2_behavior_migration.py'
- 'tests/test_settings_audit.py'
- 'tests/test_settings_behavior_migration.py'
- '.github/workflows/settings-audit.yml'
- 'docs/settings-refactor-status.md'
workflow_dispatch:
permissions:
contents: write
jobs:
audit:
runs-on: ubuntu-latest
env:
PYTHONDONTWRITEBYTECODE: "1"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
fetch-depth: 1
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Complete Phase 2 catalog migration
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'agent/settings-refactor-phase1-safety'
run: python3 scripts/phase2_catalog_migration.py
- name: Install shared settings behavior controller
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'agent/settings-refactor-phase1-safety'
run: python3 scripts/phase2_behavior_migration.py
- name: Commit Phase 2 migrations
if: github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'agent/settings-refactor-phase1-safety'
shell: bash
run: |
if git diff --quiet -- src/settings-catalog.json src/settings.qml; then
echo 'Phase 2 migrations are already applied.'
else
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add src/settings-catalog.json src/settings.qml
git commit -m 'Apply settings refactor phase 2 migrations'
git push origin HEAD:${{ github.event.pull_request.head.ref }}
fi
- name: Test settings refactor infrastructure
run: python3 -m unittest tests/test_settings_audit.py tests/test_settings_behavior_migration.py
- name: Resolve and fetch ABI base
id: base
shell: bash
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE_SHA="${{ github.event.pull_request.base.sha }}"
git fetch --no-tags --depth=1 origin "$BASE_SHA"
echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT"
else
git fetch --no-tags --depth=1 origin master
echo "sha=FETCH_HEAD" >> "$GITHUB_OUTPUT"
fi
- name: Audit persistent settings ABI and catalog
run: >-
python3 scripts/settings_audit.py
--base "${{ steps.base.outputs.sha }}"
--report settings-audit.json
- name: Upload audit inventory
if: always()
uses: actions/upload-artifact@v4
with:
name: settings-audit
path: settings-audit.json
if-no-files-found: ignore