Feature/upstream consumer improvements #30
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: | |
| # Post-merge: verify protected branches only (avoid duplicate runs with pull_request). | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| # Pre-merge: validate PRs targeting main/develop (feature/release/hotfix branches). | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Restore | |
| run: dotnet restore BioTrace.Elsa.Abp.slnx | |
| - name: Build | |
| run: dotnet build BioTrace.Elsa.Abp.slnx --no-restore -c Release | |
| - name: Test | |
| run: dotnet test BioTrace.Elsa.Abp.slnx --no-build -c Release --verbosity normal --filter "Category!=Integration" | |
| nuget-pack-verify: | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Verify NuGet transitive dependencies | |
| run: ./scripts/verify-nuget-dependencies.sh | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| INTEGRATION_TEST_POSTGRES_HOST: localhost | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Restore | |
| run: dotnet restore BioTrace.Elsa.Abp.slnx | |
| - name: Build | |
| run: dotnet build BioTrace.Elsa.Abp.slnx --no-restore -c Release | |
| - name: Create test databases | |
| run: | | |
| PGPASSWORD=postgres psql -h localhost -U postgres -c 'CREATE DATABASE "BioTrace_Abp_Test";' || true | |
| PGPASSWORD=postgres psql -h localhost -U postgres -c 'CREATE DATABASE "BioTrace_Elsa_Test";' || true | |
| - name: Integration tests | |
| run: dotnet test BioTrace.Elsa.Abp.slnx --no-build -c Release --verbosity normal --filter "Category=Integration" | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| timeout-minutes: 12 | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| CI: true | |
| E2E_POSTGRES_HOST: localhost | |
| INTEGRATION_TEST_POSTGRES_HOST: localhost | |
| E2E_BASE_URL: https://localhost:44388 | |
| PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW: '0' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: | | |
| host/BioTrace.Elsa.Abp.HttpApi.Host/package-lock.json | |
| test/BioTrace.Elsa.Abp.E2E/package-lock.json | |
| - name: Ensure development HTTPS certificate | |
| # Do not use --trust: it exits 4 on headless Ubuntu CI (no system trust store). | |
| # Playwright webServer/use already set ignoreHTTPSErrors; Kestrel only needs the cert file. | |
| run: dotnet dev-certs https | |
| - name: Restore and build | |
| run: | | |
| dotnet restore BioTrace.Elsa.Abp.slnx | |
| dotnet build BioTrace.Elsa.Abp.slnx --no-restore -c Release | |
| - name: Create E2E databases | |
| run: | | |
| PGPASSWORD=postgres psql -h localhost -U postgres -c 'CREATE DATABASE "BioTrace_Abp_E2E";' || true | |
| PGPASSWORD=postgres psql -h localhost -U postgres -c 'CREATE DATABASE "BioTrace_Elsa_E2E";' || true | |
| - name: Install Host frontend libraries | |
| run: npm ci --prefix host/BioTrace.Elsa.Abp.HttpApi.Host | |
| - name: Install E2E dependencies | |
| run: npm ci --prefix test/BioTrace.Elsa.Abp.E2E | |
| - name: Install Playwright browsers | |
| run: npx --prefix test/BioTrace.Elsa.Abp.E2E playwright install --with-deps chromium | |
| - name: E2E tests | |
| run: npm run test:e2e --prefix test/BioTrace.Elsa.Abp.E2E | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report | |
| path: test/BioTrace.Elsa.Abp.E2E/playwright-report/ | |
| retention-days: 14 |