Add: aggressive cleanup #28
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: "Test" | |
| on: | |
| pull_request: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| tests: | |
| name: "Unit and E2E Tests" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 'latest' | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run unit tests | |
| run: bun test:unit | |
| - name: Start container | |
| run: docker compose up -d | |
| - name: Wait for container to be ready | |
| run: | | |
| for i in {1..30}; do | |
| if curl -f http://localhost:3000/v1/health > /dev/null 2>&1; then | |
| echo "Container is ready!" | |
| exit 0 | |
| fi | |
| echo "Waiting for container... ($i/30)" | |
| sleep 1 | |
| done | |
| echo "Container failed to start" | |
| echo "Container logs:" | |
| docker compose logs | |
| exit 1 | |
| - name: Run e2e tests | |
| run: bun test:e2e | |
| - name: Print logs | |
| if: failure() | |
| run: docker compose logs |