fix: use PostgreSQL dialect for PRQL compilation (#54) #257
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: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # Fast checks first - formatting and linting | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| - name: Clippy | |
| run: cargo clippy -- -D warnings | |
| # Unit tests | |
| test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run unit tests | |
| run: cargo test --verbose | |
| # Build release binary | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build release binary | |
| run: cargo build --release | |
| - name: Upload binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: k8sql-linux | |
| path: target/release/k8sql | |
| retention-days: 1 | |
| # Integration tests with k3d clusters | |
| integration: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [lint, test, build] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download k8sql binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: k8sql-linux | |
| path: ./bin | |
| - name: Verify and prepare binary | |
| run: | | |
| echo "Contents of ./bin:" | |
| ls -la ./bin/ | |
| chmod +x ./bin/k8sql | |
| echo "Binary version check:" | |
| ./bin/k8sql --help | head -5 || true | |
| - name: Install k3d | |
| run: | | |
| curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash | |
| - name: Install jq | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Install kubectl | |
| uses: azure/setup-kubectl@v4 | |
| with: | |
| version: 'v1.31.0' | |
| - name: Setup test clusters | |
| run: ./tests/integration/setup-clusters.sh | |
| - name: Run integration tests | |
| run: ./tests/integration/run-tests.sh | |
| env: | |
| K8SQL: ./bin/k8sql | |
| - name: Cleanup clusters | |
| if: always() | |
| run: ./tests/integration/cleanup.sh |