-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 1.94 KB
/
Copy pathbasic-ci.yml
File metadata and controls
73 lines (62 loc) · 1.94 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
name: Basic CI
on:
push:
branches:
- main
pull_request:
jobs:
validate:
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 lightweight dependencies
run: python -m pip install --upgrade pip pyyaml
- name: Validate repository metadata files
run: |
test -f README.md
test -f LICENSE
test -f CONTRIBUTING.md
test -f .gitignore
test -f .gitattributes
test -f .editorconfig
test -f .github/CODEOWNERS
test -f .github/pull_request_template.md
test -f .github/ISSUE_TEMPLATE/bug_report.md
test -f .github/ISSUE_TEMPLATE/feature_request.md
- name: Validate README sections
run: |
grep -q '^## Quick Links' README.md
grep -q '^## Current Scope' README.md
grep -q '^## Repository Layout' README.md
grep -q '^## Getting Started' README.md
grep -q '^## Typical Workflow' README.md
grep -q '^## Contributing' README.md
grep -q '^## License' README.md
- name: Check Python syntax
run: |
python -m compileall \
scripts \
generated_openram_configs \
generated_openram_power_configs
- name: Validate YAML configs
run: |
python - <<'PY'
from pathlib import Path
import yaml
for path in Path("configs").glob("*.y*ml"):
with path.open("r", encoding="utf-8") as f:
yaml.safe_load(f)
print(f"validated {path}")
PY
- name: Check shell script syntax
run: |
shopt -s nullglob
for file in scripts/*.sh; do
bash -n "$file"
echo "validated $file"
done