Repository navigation
Perf: scaffold DB perf test project (manual-first) #1
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: DB Perf Tests (Manual) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| provider: | |
| description: "Database provider to benchmark" | |
| required: true | |
| default: both | |
| type: choice | |
| options: | |
| - both | |
| - sqlite | |
| - postgres | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/db-perf-manual.yml' | |
| - 'src/Agoda.DevExTelemetry.DbPerfTests/**' | |
| - 'src/Agoda.DevExTelemetry.Core/**' | |
| - 'src/Agoda.DevExTelemetry.WebApi/**' | |
| - 'docs/db-perf-tests.md' | |
| jobs: | |
| sqlite: | |
| if: ${{ github.event_name == 'pull_request' || github.event.inputs.provider == 'both' || github.event.inputs.provider == 'sqlite' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore | |
| run: dotnet restore src/Agoda.DevExTelemetry.DbPerfTests/Agoda.DevExTelemetry.DbPerfTests.csproj | |
| - name: Run SQLite perf tests | |
| env: | |
| PERF_DB_PROVIDER: sqlite | |
| run: dotnet test src/Agoda.DevExTelemetry.DbPerfTests/Agoda.DevExTelemetry.DbPerfTests.csproj --configuration Release --logger "trx;LogFileName=sqlite-perf.trx" | |
| - name: Upload SQLite artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: sqlite-db-perf-results | |
| path: | | |
| **/db-perf-results/*.json | |
| **/sqlite-perf.trx | |
| postgres: | |
| if: ${{ github.event_name == 'pull_request' || github.event.inputs.provider == 'both' || github.event.inputs.provider == 'postgres' }} | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore | |
| run: dotnet restore src/Agoda.DevExTelemetry.DbPerfTests/Agoda.DevExTelemetry.DbPerfTests.csproj | |
| - name: Run PostgreSQL perf tests | |
| env: | |
| PERF_DB_PROVIDER: postgres | |
| PERF_POSTGRES_CONNECTION: Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=postgres | |
| run: dotnet test src/Agoda.DevExTelemetry.DbPerfTests/Agoda.DevExTelemetry.DbPerfTests.csproj --configuration Release --logger "trx;LogFileName=postgres-perf.trx" | |
| - name: Upload PostgreSQL artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: postgres-db-perf-results | |
| path: | | |
| **/db-perf-results/*.json | |
| **/postgres-perf.trx |