feat: implement comprehensive health check endpoints #307
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: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| # Node.js Job for Backend & Frontend | |
| node-ci: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: timescale/timescaledb:latest-pg15 | |
| env: | |
| POSTGRES_DB: bridge_watch_test | |
| POSTGRES_USER: bridge_watch | |
| POSTGRES_PASSWORD: test_password | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| working-directory: backend | |
| run: npm ci | |
| - name: Lint backend | |
| working-directory: backend | |
| run: npm run lint | |
| - name: Build backend | |
| working-directory: backend | |
| run: npm run build | |
| - name: Run backend tests | |
| working-directory: backend | |
| run: npm run test -- --coverage | |
| env: | |
| NODE_ENV: test | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_DB: bridge_watch_test | |
| POSTGRES_USER: bridge_watch | |
| POSTGRES_PASSWORD: test_password | |
| REDIS_HOST: localhost | |
| REDIS_PORT: 6379 | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./backend/coverage/coverage-final.json | |
| flags: backend | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| continue-on-error: true | |
| frontend: | |
| name: Frontend Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| - name: Test | |
| run: npm run test | |
| continue-on-error: true | |
| # Rust Job for Smart Contracts | |
| rust-ci: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: contracts | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| contracts/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('contracts/Cargo.lock') }} | |
| - name: Format Check | |
| run: cargo fmt --all -- --check | |
| continue-on-error: true | |
| - name: Lint (Clippy) | |
| run: cargo clippy -- -D warnings | |
| continue-on-error: true | |
| - name: Build | |
| run: cargo build --verbose | |
| continue-on-error: true | |
| - name: Test | |
| run: cargo test --verbose | |
| continue-on-error: true |