[codex] Add Zoho support ticket flow (#252) #509
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: Server CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - "server/**" | |
| - "scripts/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - ".github/workflows/**" | |
| - "!**/*.md" | |
| jobs: | |
| changes: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| outputs: | |
| server_changed: ${{ steps.set_changed.outputs.server_changed }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: 🔎 Detect server-related changes | |
| id: filter | |
| if: github.event_name == 'pull_request' | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| server: | |
| - 'server/**' | |
| - 'scripts/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/**' | |
| - name: 🧭 Set server change output | |
| id: set_changed | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| FILTER_SERVER: ${{ steps.filter.outputs.server }} | |
| run: | | |
| if [[ "$EVENT_NAME" == "pull_request" ]]; then | |
| echo "server_changed=${FILTER_SERVER}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "server_changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| server_build_and_test: | |
| needs: changes | |
| if: needs.changes.outputs.server_changed == 'true' | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: noah_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| dragonfly: | |
| image: docker.dragonflydb.io/dragonflydb/dragonfly:latest | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: 📦 Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev protobuf-compiler | |
| - name: 🦀 Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt | |
| - name: ✨ Check formatting | |
| run: cargo fmt --check | |
| - name: 🧪 Run tests | |
| env: | |
| TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/noah_test | |
| TEST_REDIS_URL: redis://127.0.0.1:6379 | |
| run: cargo test | |
| - name: 🔨 Build noah-cli | |
| run: cargo build --release --bin noah-cli | |
| server_gate: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| needs: [changes, server_build_and_test] | |
| if: always() | |
| steps: | |
| - name: ✅ Gate | |
| run: | | |
| if [[ "${{ needs.changes.result }}" != "success" ]]; then | |
| echo "Server change detection failed" | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.changes.outputs.server_changed }}" != "true" ]]; then | |
| echo "No server-related changes; server checks not required" | |
| exit 0 | |
| fi | |
| if [[ "${{ needs.server_build_and_test.result }}" == "success" ]]; then | |
| echo "Server checks passed" | |
| exit 0 | |
| else | |
| echo "Server checks failed" | |
| exit 1 | |
| fi |