|
| 1 | +name: build/test rabbitmq-dotnet-client |
| 2 | + |
| 3 | +on: |
| 4 | + - workflow_call |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-win32: |
| 8 | + name: build/test on windows-latest |
| 9 | + runs-on: windows-latest |
| 10 | + # https://github.com/NuGet/Home/issues/11548 |
| 11 | + env: |
| 12 | + NUGET_CERT_REVOCATION_MODE: offline |
| 13 | + steps: |
| 14 | + - name: Clone repository |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + submodules: true |
| 18 | + - name: Cache installers |
| 19 | + uses: actions/cache@v3 |
| 20 | + with: |
| 21 | + # Note: the cache path is relative to the workspace directory |
| 22 | + # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action |
| 23 | + path: ~/installers |
| 24 | + key: ${{ runner.os }}-v0-${{ hashFiles('.ci/versions.json') }} |
| 25 | + - name: Cache NuGet packages |
| 26 | + uses: actions/cache@v3 |
| 27 | + with: |
| 28 | + path: | |
| 29 | + ~/.nuget/packages |
| 30 | + ~/AppData/Local/NuGet/v3-cache |
| 31 | + key: ${{ runner.os }}-v1-nuget-${{ hashFiles('**/*.csproj') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-v1-nuget- |
| 34 | + - name: Install and Start RabbitMQ |
| 35 | + run: .\.ci\windows\gha-setup.ps1 |
| 36 | + - name: List NuGet sources |
| 37 | + run: dotnet nuget locals all --list |
| 38 | + - name: Build |
| 39 | + run: dotnet build ${{ github.workspace }}\Build.csproj |
| 40 | + - name: Verify |
| 41 | + run: dotnet format ${{ github.workspace }}\RabbitMQDotNetClient.sln --verify-no-changes --verbosity=diagnostic |
| 42 | + - name: Test |
| 43 | + run: .\.ci\windows\gha-run-tests.ps1 |
| 44 | + - name: Maybe upload RabbitMQ logs |
| 45 | + if: failure() |
| 46 | + uses: actions/upload-artifact@v3 |
| 47 | + with: |
| 48 | + name: rabbitmq-logs |
| 49 | + path: ~/AppData/Roaming/RabbitMQ/log/ |
| 50 | + build: |
| 51 | + name: build/test on ubuntu-latest |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Clone repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + submodules: true |
| 58 | + - name: Setup .NET |
| 59 | + uses: actions/setup-dotnet@v3 |
| 60 | + with: |
| 61 | + dotnet-version: 6.x |
| 62 | + - name: Cache NuGet packages |
| 63 | + uses: actions/cache@v3 |
| 64 | + with: |
| 65 | + path: | |
| 66 | + ~/.nuget/packages |
| 67 | + ~/.local/share/NuGet/v3-cache |
| 68 | + key: ${{ runner.os }}-v1-nuget-${{ hashFiles('**/*.csproj') }} |
| 69 | + restore-keys: | |
| 70 | + ${{ runner.os }}-v1-nuget- |
| 71 | + - name: Start RabbitMQ |
| 72 | + id: start-rabbitmq |
| 73 | + run: ${{ github.workspace }}/.ci/ubuntu/gha-setup.sh |
| 74 | + - name: List NuGet sources |
| 75 | + run: dotnet nuget locals all --list |
| 76 | + - name: Build |
| 77 | + run: dotnet build ${{ github.workspace }}/Build.csproj |
| 78 | + - name: Verify |
| 79 | + run: dotnet format ${{ github.workspace }}/RabbitMQDotNetClient.sln --verify-no-changes --verbosity=diagnostic |
| 80 | + - name: Test |
| 81 | + run: | |
| 82 | + dotnet test \ |
| 83 | + --environment "RABBITMQ_RABBITMQCTL_PATH=DOCKER:${{ steps.start-rabbitmq.outputs.id }}" \ |
| 84 | + --environment 'RABBITMQ_LONG_RUNNING_TESTS=true' \ |
| 85 | + --environment 'PASSWORD=grapefruit' \ |
| 86 | + --environment SSL_CERTS_DIR="${{ github.workspace }}/.ci/certs" \ |
| 87 | + "${{ github.workspace }}/projects/Unit/Unit.csproj" --no-restore --no-build --logger 'console;verbosity=detailed' --framework 'net6.0' |
| 88 | + - name: Maybe upload RabbitMQ logs |
| 89 | + if: failure() |
| 90 | + uses: actions/upload-artifact@v3 |
| 91 | + with: |
| 92 | + name: rabbitmq-logs |
| 93 | + path: ${{ github.workspace }}/.ci/ubuntu/log/ |
0 commit comments