ci(validation): consolidate pattern validation into a single job #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Regex Patterns | |
| on: | |
| push: | |
| paths: | |
| - "regex_patterns/**/*.yml" | |
| - "regex_patterns/**/*.yaml" | |
| - ".github/workflows/regex.yml" | |
| - "scripts/validatePattern.ps1" | |
| pull_request: | |
| paths: | |
| - "regex_patterns/**/*.yml" | |
| - "regex_patterns/**/*.yaml" | |
| - ".github/workflows/regex.yml" | |
| - "scripts/validatePattern.ps1" | |
| workflow_dispatch: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PowerShell | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y powershell | |
| - name: Validate All Patterns | |
| run: | | |
| failed=0 | |
| for file in regex_patterns/*.yml regex_patterns/*.yaml; do | |
| if [ -f "$file" ]; then | |
| echo "Validating: $file" | |
| if ! pwsh scripts/validatePattern.ps1 -YamlFilePath "$file"; then | |
| failed=$((failed + 1)) | |
| fi | |
| fi | |
| done | |
| if [ $failed -gt 0 ]; then | |
| echo "❌ $failed pattern(s) failed validation" | |
| exit 1 | |
| else | |
| echo "✅ All patterns validated successfully" | |
| fi | |
| - name: Run Unit Tests | |
| run: | | |
| echo "TODO: Implement unit tests for all patterns" | |
| # TODO: Add test runner command here |