-
Notifications
You must be signed in to change notification settings - Fork 0
Add workflow to validate repository structure #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: Validate Repository Structure | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| pull_request: | ||
| branches: [ main, master ] | ||
|
|
||
| jobs: | ||
| validate-structure: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Validate required directories | ||
| run: | | ||
| echo "Checking for required directories..." | ||
| required_dirs=("model" "docs" "scripts" "data" "screenshots") | ||
|
|
||
| for dir in "${required_dirs[@]}"; do | ||
| if [ ! -d "$dir" ]; then | ||
| echo "❌ ERROR: Required directory missing: $dir" | ||
| exit 1 | ||
| else | ||
| echo "✅ Found directory: $dir" | ||
| fi | ||
| done | ||
|
|
||
| - name: Validate required documentation files | ||
| run: | | ||
| echo "Checking for required documentation files..." | ||
| required_files=("README.md" "LICENSE" "CONTRIBUTING.md" "docs/METHODOLOGY.md" "docs/ASSUMPTIONS.md") | ||
|
|
||
| for file in "${required_files[@]}"; do | ||
| if [ ! -f "$file" ]; then | ||
| echo "❌ ERROR: Required file missing: $file" | ||
| exit 1 | ||
| else | ||
| echo "✅ Found file: $file" | ||
| fi | ||
| done | ||
|
Comment on lines
+33
to
+43
|
||
|
|
||
| - name: Check for large files | ||
| run: | | ||
| echo "Scanning for files exceeding 100MB..." | ||
| large_files=$(find . -type f -size +100M ! -path "./.git/*" ! -path "./node_modules/*" ! -path "./.venv/*" 2>/dev/null) | ||
|
|
||
| if [ -n "$large_files" ]; then | ||
| echo "❌ ERROR: Large files detected (>100MB):" | ||
| echo "$large_files" | ||
| exit 1 | ||
| else | ||
| echo "✅ No large files detected" | ||
| fi | ||
|
|
||
| - name: Validate README sections | ||
| run: | | ||
| echo "Validating README.md content..." | ||
| required_sections=("Overview" "Problem Statement" "Key Capabilities" "System Architecture" "Repository Structure") | ||
|
|
||
| for section in "${required_sections[@]}"; do | ||
| if grep -q "^## .*$section\|^### .*$section" README.md; then | ||
| echo "✅ Found section: $section" | ||
| else | ||
| echo "⚠️ Section not found in README: $section" | ||
| fi | ||
| done | ||
|
|
||
| - name: Validate file permissions and formats | ||
| run: | | ||
| echo "Checking file formats and permissions..." | ||
| if [ -f "docs/METHODOLOGY.md" ] && [ -f "docs/ASSUMPTIONS.md" ]; then | ||
| echo "✅ Required markdown files present" | ||
| fi | ||
|
Comment on lines
+71
to
+76
|
||
|
|
||
| - name: Summary | ||
| if: success() | ||
| run: | | ||
| echo "✅ All repository structure validations passed!" | ||
| echo "Repository is ready for collaboration." | ||
|
|
||
| - name: Failure Summary | ||
| if: failure() | ||
| run: | | ||
| echo "❌ Repository structure validation failed." | ||
| echo "Please review the errors above and fix any missing files or directories." | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow will currently fail on every push/PR because it enforces directories (model/docs/scripts/data/screenshots) that do not exist in the repository. Either add these directories in the same PR (e.g., with placeholder files) or relax/gate the check (e.g., only warn or run on workflow_dispatch until the structure is in place).