feat: [ENG-3586] AI Gateway Stats page MVP #136
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: ClickHouse Migration Check | |
| on: | |
| pull_request: | |
| paths: | |
| - 'clickhouse/migrations/**' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'clickhouse/migrations/**' | |
| jobs: | |
| check-migrations: | |
| name: Check Migrations | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Check Migration Numbers | |
| run: | | |
| python - <<EOF | |
| import os | |
| import re | |
| import sys | |
| files = [f for f in os.listdir('clickhouse/migrations') if f.startswith('schema_') and f.endswith('.sql')] | |
| if not files: | |
| print("No migrations found") | |
| sys.exit(1) | |
| nums = [] | |
| for f in files: | |
| match = re.search(r'schema_(\d+)_', f) | |
| if match: | |
| nums.append(int(match.group(1))) | |
| nums.sort() | |
| if len(nums) != len(set(nums)): | |
| print("Found duplicate numbers") | |
| sys.exit(1) | |
| if list(range(min(nums), max(nums) + 1)) != nums: | |
| print("Found gaps in numbers") | |
| sys.exit(1) | |
| print(f"OK - {len(nums)} migrations from {min(nums)} to {max(nums)}") | |
| EOF |