chore(ai): remove /ai-review — superseded by automatic AI reviewers (… #80
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: Rust, Docker, Code Coverage | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| # Cancel superseded runs when a branch is pushed repeatedly. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Deploy feature set mirrors scripts/deploy-features.sh (DEPLOY_FEATURES). | |
| features: ["", "--features \"opentelemetry ai-openrouter\"", "--all-features"] | |
| env: | |
| SQLX_OFFLINE: true | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo clippy --all-targets ${{ matrix.features }} -- -D warnings | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Deploy feature set mirrors scripts/deploy-features.sh (DEPLOY_FEATURES). | |
| features: ["", "--features \"opentelemetry ai-openrouter\"", "--all-features"] | |
| env: | |
| SQLX_OFFLINE: true | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo build --verbose ${{ matrix.features }} | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:18.2 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: bot_database | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d bot_database" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:8 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_URL: postgres://postgres:password@localhost:5432/bot_database | |
| REDIS_URL: redis://localhost:6379 | |
| RUST_BACKTRACE: full | |
| # Clippy/Build run before "Run database migrations", so compile sqlx's | |
| # query! macros against the committed .sqlx cache instead of the (empty, | |
| # un-migrated) live DB. Matches the local pre-commit hook, which has no | |
| # database. Migrations still run before the tests, which connect at runtime. | |
| SQLX_OFFLINE: "true" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install sqlx-cli | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: sqlx-cli | |
| - name: Wait for Postgres | |
| run: until pg_isready -h localhost -p 5432; do sleep 2; done | |
| - name: Run database migrations | |
| run: sqlx migrate run | |
| - name: Run tests | |
| run: cargo test --verbose --all-features -- --nocapture | |
| - name: Install llvm-tools for coverage | |
| run: rustup component add llvm-tools-preview | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Coverage | |
| continue-on-error: true | |
| run: bash scripts/coverage.sh | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: lcov.info | |
| fail_ci_if_error: true | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Create filler .env for Docker build | |
| run: | | |
| echo "DATABASE_URL=postgres://postgres:password@localhost:5432/bot_database" > .env | |
| echo "BOT_TOKEN=dummy_token" >> .env | |
| - name: Build Docker image | |
| run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) |