test(worker): end-to-end DeliveryWorker coverage with Testcontainers … #79
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] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| DOTNET_VERSION: "10.0.x" | |
| BUN_VERSION: "1.2.x" | |
| jobs: | |
| backend: | |
| name: Backend (build + test) | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: webhookengine_test | |
| POSTGRES_USER: webhookengine | |
| POSTGRES_PASSWORD: webhookengine | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U webhookengine" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore WebhookEngine.sln | |
| - name: Build | |
| run: dotnet build WebhookEngine.sln --no-restore --configuration Release | |
| - name: Test | |
| run: dotnet test WebhookEngine.sln --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" | |
| env: | |
| ConnectionStrings__Default: "Host=localhost;Port=5432;Database=webhookengine_test;Username=webhookengine;Password=webhookengine" | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: "**/test-results.trx" | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: coverage | |
| path: "**/coverage.cobertura.xml" | |
| frontend: | |
| name: Frontend (build + lint) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/dashboard | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Lint | |
| run: bun run lint | |
| - name: Type check | |
| run: bun run typecheck | |
| - name: Build | |
| run: bun run build | |
| docker: | |
| name: Docker build | |
| runs-on: ubuntu-latest | |
| needs: [backend, frontend] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| push: false | |
| tags: webhook-engine:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |