Skip to content

Commit 5031b6e

Browse files
committed
ci: validate example configs on push.
1 parent eee7de5 commit 5031b6e

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Validate Configuration Files
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- 'examples/**/*.yaml'
8+
- 'examples/**/*.yml'
9+
- 'tools/validate_config/**'
10+
pull_request:
11+
branches: [ main, develop ]
12+
paths:
13+
- 'examples/**/*.yaml'
14+
- 'examples/**/*.yml'
15+
- 'tools/validate_config/**'
16+
17+
jobs:
18+
validate-configs:
19+
runs-on: ubuntu-latest
20+
name: Validate Imposter Configuration Files
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Install dependencies
32+
run: |
33+
cd tools/validate_config
34+
python -m venv venv
35+
source venv/bin/activate
36+
pip install --upgrade pip
37+
pip install -r requirements.txt
38+
39+
- name: Validate configuration files (Current Schema)
40+
run: |
41+
cd tools/validate_config
42+
source venv/bin/activate
43+
echo "🔍 Validating configuration files against current schema..."
44+
python validate_configs.py ../../examples/

tools/validate_config/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ source venv/bin/activate # On Unix/macOS
1717
pip install -r requirements.txt
1818
```
1919

20+
## Continuous Integration
21+
22+
The configuration validation is automated via GitHub Actions. The workflow `.github/workflows/validate-configs.yml` runs on every push and pull request that modifies:
23+
24+
- Configuration files in `examples/` directory (`*.yaml`, `*.yml`)
25+
- Validation schema files in `tools/validate_config/`
26+
27+
The CI validates configurations against both current and legacy schemas to ensure backward compatibility.
28+
2029
## Usage
2130

2231
Run the validator by providing a directory containing config files to validate:

0 commit comments

Comments
 (0)