Mark SourceFlow.Cloud.Azure as 2.0.0-beta.1 prerelease #10
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
| # Builds and tests the Azure Service Bus cloud extension. | |
| # Mirrors the AWS Master-Build pipeline (which uses LocalStack); the Azure | |
| # equivalent of LocalStack is the Azure Service Bus emulator (+ SQL Edge), | |
| # started from .github/azure-emulator/docker-compose.yml. | |
| name: azure-build | |
| on: | |
| push: | |
| branches: [ "azure-cloud" ] | |
| paths-ignore: | |
| - "**/*.md" | |
| - "**/*.gitignore" | |
| - "**/*.gitattributes" | |
| pull_request: | |
| branches: [ "azure-cloud", "master" ] | |
| paths-ignore: | |
| - "**/*.md" | |
| - "**/*.gitignore" | |
| - "**/*.gitattributes" | |
| jobs: | |
| # Build + unit tests. These have no external dependencies and must always pass. | |
| build-and-unit-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Restore | |
| run: dotnet restore SourceFlow.Net.sln | |
| - name: Build | |
| run: dotnet build SourceFlow.Net.sln --configuration Release --no-restore | |
| - name: Run Azure unit tests | |
| run: >- | |
| dotnet test tests/SourceFlow.Cloud.Azure.Tests/SourceFlow.Cloud.Azure.Tests.csproj | |
| --configuration Release --no-build --verbosity normal | |
| --filter "Category=Unit" | |
| - name: Pack SourceFlow.Cloud.Azure | |
| run: dotnet pack src/SourceFlow.Cloud.Azure/SourceFlow.Cloud.Azure.csproj --configuration Release --no-build --output ./packages | |
| - name: Upload package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: azure-nupkg | |
| path: ./packages/*.nupkg | |
| retention-days: 7 | |
| # Integration tests against the Azure Service Bus emulator. | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| env: | |
| MSSQL_SA_PASSWORD: "SourceFlow!Emulator1" | |
| # Emulator client connection string (documented default for the emulator image). | |
| AZURE_SERVICEBUS_CONNECTION_STRING: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Start Azure Service Bus emulator | |
| working-directory: .github/azure-emulator | |
| run: docker compose up -d | |
| # A TCP check on 5672 is unreliable: Docker's port proxy accepts the | |
| # connection before the emulator app binds (and while SQL Edge is still | |
| # initialising). Wait for the emulator's readiness log line instead. | |
| - name: Wait for emulator to be ready | |
| working-directory: .github/azure-emulator | |
| run: | | |
| echo "Waiting for the Service Bus emulator to report ready..." | |
| for i in $(seq 1 60); do | |
| logs=$(docker compose logs sb-emulator 2>&1) | |
| if echo "$logs" | grep -qi "Emulator Service is Successfully Up"; then | |
| echo "Emulator is ready." | |
| sleep 5 # small settle margin | |
| exit 0 | |
| fi | |
| if echo "$logs" | grep -qiE "Error occured while running emulator launcher|Hosting failed to start"; then | |
| echo "ERROR: emulator failed to start (config rejected):" | |
| echo "$logs" | grep -iE "Error occured|Expected" | head -5 | |
| docker compose logs | |
| exit 1 | |
| fi | |
| echo "Attempt $i/60 - emulator not ready yet, waiting..." | |
| sleep 5 | |
| done | |
| echo "ERROR: emulator did not become ready in time" | |
| docker compose logs | |
| exit 1 | |
| - name: Restore & build | |
| run: | | |
| dotnet restore SourceFlow.Net.sln | |
| dotnet build SourceFlow.Net.sln --configuration Release --no-restore | |
| # The emulator exposes only the AMQP endpoint (5672) — it has no HTTP | |
| # management endpoint, so ServiceBusAdministrationClient calls fail. We run | |
| # the suites that tolerate that (pre-declared entities in Config.json + AMQP | |
| # send/receive). Suites that hard-require the management API, Key Vault, | |
| # Managed Identity, SQL rule filters, or runtime entity creation are excluded. | |
| # Each suite runs as its own step so the per-class filter stays AND-only | |
| # (VSTest has no parentheses and mixes &/| left-to-right unreliably). | |
| - name: Integration — command dispatching | |
| run: >- | |
| dotnet test tests/SourceFlow.Cloud.Azure.Tests/SourceFlow.Cloud.Azure.Tests.csproj | |
| --configuration Release --no-build --verbosity normal | |
| --filter "FullyQualifiedName~ServiceBusCommandDispatchingTests&FullyQualifiedName!~DeadLetterQueue_SupportsResubmission&FullyQualifiedName!~SessionHandling_MultipleSessions_ProcessIndependently&FullyQualifiedName!~SessionHandling_PreservesOrderWithinSession" | |
| -- RunConfiguration.TestSessionTimeout=600000 | |
| - name: Integration — event publishing | |
| run: >- | |
| dotnet test tests/SourceFlow.Cloud.Azure.Tests/SourceFlow.Cloud.Azure.Tests.csproj | |
| --configuration Release --no-build --verbosity normal | |
| --filter "FullyQualifiedName~ServiceBusEventPublishingTests" | |
| -- RunConfiguration.TestSessionTimeout=600000 | |
| # SessionLockRenewal and MultipleConcurrentSessions exercise emulator | |
| # session lock-renewal / concurrent-session timing that diverges from real | |
| # Azure (same quirk excluded in the command suite); skip them here. | |
| - name: Integration — event session handling | |
| run: >- | |
| dotnet test tests/SourceFlow.Cloud.Azure.Tests/SourceFlow.Cloud.Azure.Tests.csproj | |
| --configuration Release --no-build --verbosity normal | |
| --filter "FullyQualifiedName~ServiceBusEventSessionHandlingTests&FullyQualifiedName!~SessionLockRenewal_MaintainsLock&FullyQualifiedName!~MultipleConcurrentSessions_ProcessIndependently" | |
| -- RunConfiguration.TestSessionTimeout=600000 | |
| - name: Dump emulator logs on failure | |
| if: failure() | |
| working-directory: .github/azure-emulator | |
| run: docker compose logs |