mirror of
https://github.com/Dictionarry-Hub/database.git
synced 2025-12-10 15:57:00 +00:00
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
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
|