|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + validate: |
| 11 | + name: Validate configuration |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Validate docker-compose |
| 17 | + run: docker compose config --quiet |
| 18 | + |
| 19 | + - name: Check no secrets committed |
| 20 | + run: | |
| 21 | + if [ -f .env ]; then |
| 22 | + echo "ERROR: .env file should not be committed" |
| 23 | + exit 1 |
| 24 | + fi |
| 25 | +
|
| 26 | + - name: Validate dbt project |
| 27 | + run: | |
| 28 | + pip install -q dbt-core dbt-clickhouse |
| 29 | + cd dbt && dbt parse --profiles-dir . || true |
| 30 | +
|
| 31 | + frontend: |
| 32 | + name: Build frontend |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - uses: actions/setup-node@v4 |
| 38 | + with: |
| 39 | + node-version: 20 |
| 40 | + cache: npm |
| 41 | + cache-dependency-path: frontend/package.json |
| 42 | + |
| 43 | + - name: Install dependencies |
| 44 | + working-directory: frontend |
| 45 | + run: npm install |
| 46 | + |
| 47 | + - name: Build |
| 48 | + working-directory: frontend |
| 49 | + run: npm run build |
| 50 | + |
| 51 | + - name: Check build output |
| 52 | + run: test -d frontend/dist |
| 53 | + |
| 54 | + lint: |
| 55 | + name: Lint pipeline code |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + |
| 60 | + - uses: actions/setup-python@v5 |
| 61 | + with: |
| 62 | + python-version: "3.11" |
| 63 | + |
| 64 | + - name: Install linters |
| 65 | + run: pip install -q ruff |
| 66 | + |
| 67 | + - name: Lint Python |
| 68 | + run: ruff check pipelines/ --select E,W,F --ignore E501 |
| 69 | + |
| 70 | + integration: |
| 71 | + name: Integration test (services boot) |
| 72 | + runs-on: ubuntu-latest |
| 73 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v4 |
| 76 | + |
| 77 | + - name: Copy env |
| 78 | + run: cp .env.example .env |
| 79 | + |
| 80 | + - name: Start core services |
| 81 | + run: | |
| 82 | + docker compose up -d minio minio-init clickhouse |
| 83 | + sleep 30 |
| 84 | +
|
| 85 | + - name: Verify ClickHouse responds |
| 86 | + run: | |
| 87 | + curl -sf "http://localhost:8123/ping" | grep -q "Ok." |
| 88 | +
|
| 89 | + - name: Verify MinIO responds |
| 90 | + run: | |
| 91 | + curl -sf "http://localhost:9000/minio/health/live" |
| 92 | +
|
| 93 | + - name: Cleanup |
| 94 | + if: always() |
| 95 | + run: docker compose down -v |
0 commit comments