From 3f7b0d1085ba879f3af28acb53e8597f2f90ef98 Mon Sep 17 00:00:00 2001 From: Korolev Dmitry Date: Tue, 4 Nov 2025 13:49:50 +0100 Subject: [PATCH] use services --- .github/workflows/dotnet-build-and-test.yml | 30 ++++++--------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml index 02be58079b..381481aa0f 100644 --- a/.github/workflows/dotnet-build-and-test.yml +++ b/.github/workflows/dotnet-build-and-test.yml @@ -64,6 +64,14 @@ jobs: - { targetFramework: "net9.0", os: "windows-latest", configuration: Release } - { targetFramework: "net472", os: "windows-latest", configuration: Release, integration-tests: true, environment: "integration" } + services: + azurite: + image: mcr.microsoft.com/azure-storage/azurite:latest + ports: + - 10000:10000 + - 10001:10001 + - 10002:10002 + runs-on: ${{ matrix.os }} environment: ${{ matrix.environment }} steps: @@ -80,28 +88,6 @@ jobs: uses: actions/setup-dotnet@v5.0.0 with: global-json-file: ${{ github.workspace }}/dotnet/global.json - - - name: Setup Azurite (Azure Storage Emulator) - if: matrix.integration-tests - shell: bash - run: | - # Install Azurite globally using npm (available on all GitHub runners) - npm install -g azurite - - # Start Azurite in the background - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - # On Linux, use nohup to run in background - nohup azurite --silent --location /tmp/azurite --debug /tmp/azurite/debug.log & - # Wait for Azurite to be ready - timeout 30 bash -c 'until curl -f http://localhost:10000 2>/dev/null; do sleep 1; done' - else - # On Windows, use PowerShell to start in background - powershell -Command "Start-Process azurite -ArgumentList '--silent', '--location', '$env:TEMP\azurite', '--debug', '$env:TEMP\azurite\debug.log' -WindowStyle Hidden" - # Wait for Azurite to be ready (simple sleep since curl might not be available) - sleep 10 - fi - - echo "Azurite started successfully" - name: Build dotnet solutions shell: bash