-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (58 loc) · 2.45 KB
/
validate.yml
File metadata and controls
76 lines (58 loc) · 2.45 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
name: Validate Repository
on:
pull_request:
push:
branches:
- master
permissions:
contents: read
jobs:
validate:
name: Validate docs and metadata
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install validation dependencies
run: python -m pip install --upgrade pip PyYAML
- name: Check Python syntax
run: python -m py_compile scripts/apcp_core_files.py scripts/apcp-gather.py scripts/apcp-install.py scripts/validate-repo.py
- name: Run unit tests
run: python -m unittest discover -s tests
- name: Check PowerShell syntax
shell: pwsh
run: |
$hadError = $false
foreach ($file in Get-ChildItem -Path scripts -Filter *.ps1) {
$tokens = $null
$parseErrors = $null
[System.Management.Automation.Language.Parser]::ParseFile($file.FullName, [ref]$tokens, [ref]$parseErrors) | Out-Null
if ($parseErrors.Count -gt 0) {
$hadError = $true
Write-Output "PowerShell syntax error in $($file.FullName)"
$parseErrors | ForEach-Object { Write-Output $_.Message }
}
}
if ($hadError) { exit 1 }
- name: Validate required files
run: python scripts/validate-repo.py --only required-files
- name: Validate metadata formats
run: python scripts/validate-repo.py --only json-metadata --only yaml-files --only svg-social-preview
- name: Validate required metadata fields
run: python scripts/validate-repo.py --only metadata-required-fields
- name: Validate TASK_PROGRESS schema
run: python scripts/validate-repo.py --only task-progress-schema
- name: Validate core file consistency
run: python scripts/validate-repo.py --only core-file-consistency
- name: Validate hygiene rules
run: python scripts/validate-repo.py --only template-hygiene --only generated-context-hygiene --only emoji-policy --only secret-pattern-scan
- name: Validate Markdown links
run: python scripts/validate-repo.py --only markdown-links
- name: Validate context gathering
run: python scripts/validate-repo.py --only context-gatherer
- name: Ensure generated bundle was cleaned
run: test ! -e PROMPT_READY.txt