-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1149 from rabbitmq/rabbitmq-dotnet-client-934
Add Windows GitHub build (cherry picked from commit 8324fa0) Attempt to speed up nuget package restort, Unit project updates Update docker image Set Repo URL in project
- Loading branch information
1 parent
0c95330
commit eb035d6
Showing
10 changed files
with
184 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: rabbitmq-dotnet-client | ||
|
||
on: | ||
push: | ||
branches: [ 6.x ] | ||
pull_request: | ||
branches: [ 6.x ] | ||
|
||
jobs: | ||
build-win32: | ||
name: build/test on windows-latest | ||
|
||
runs-on: windows-latest | ||
|
||
# https://github.com/NuGet/Home/issues/11548 | ||
env: | ||
NUGET_CERT_REVOCATION_MODE: offline | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Cache installers | ||
uses: actions/cache@v2 | ||
with: | ||
# Note: the cache path is relative to the workspace directory | ||
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action | ||
path: ~/installers | ||
key: ${{ runner.os }}-v0-${{ hashFiles('tools/versions.json') }} | ||
- name: Cache NuGet packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.nuget/packages | ||
~/AppData/Local/NuGet/v3-cache | ||
key: ${{ runner.os }}-v0-nuget-${{ hashFiles('**/*.csproj') }} | ||
restore-keys: | | ||
${{ runner.os }}-v0-nuget- | ||
- name: Install and start RabbitMQ | ||
run: ./tools/install.ps1 | ||
- name: List NuGet sources | ||
run: dotnet nuget locals all --list | ||
- name: Restore | ||
run: dotnet restore --verbosity=normal | ||
- name: ApiGen | ||
run: dotnet run --project ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 ./projects/specs/amqp0-9-1.stripped.xml ./gensrc/autogenerated-api-0-9-1.cs | ||
- name: Build | ||
run: dotnet build --no-restore --verbosity=normal | ||
- name: Test | ||
run: ./tools/gha-run-tests.ps1 | ||
|
||
build: | ||
name: build/test on ubuntu-latest | ||
|
||
runs-on: ubuntu-latest | ||
|
||
services: | ||
rabbitmq: | ||
image: pivotalrabbitmq/rabbitmq:master-otp-max | ||
ports: | ||
- 5672:5672 | ||
- 15672:15672 | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Cache NuGet packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.nuget/packages | ||
~/.local/share/NuGet/v3-cache | ||
key: ${{ runner.os }}-v0-nuget-${{ hashFiles('**/*.csproj') }} | ||
restore-keys: | | ||
${{ runner.os }}-v0-nuget- | ||
- name: Restore | ||
run: dotnet restore --verbosity=normal | ||
- name: ApiGen | ||
run: dotnet run --project ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 ./projects/specs/amqp0-9-1.stripped.xml ./gensrc/autogenerated-api-0-9-1.cs | ||
- name: Build | ||
run: dotnet build --no-restore --verbosity=normal | ||
- name: Test | ||
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "netcoreapp3.1" | ||
env: | ||
RABBITMQ_RABBITMQCTL_PATH: DOCKER:${{job.services.rabbitmq.id}} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@ECHO OFF | ||
set DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
dotnet restore .\RabbitMQDotNetClient.sln | ||
dotnet run --project .\projects\Apigen\Apigen.csproj --apiName:AMQP_0_9_1 .\projects\specs\amqp0-9-1.stripped.xml .\gensrc\autogenerated-api-0-9-1.cs | ||
dotnet build .\RabbitMQDotNetClient.sln | ||
dotnet restore --verbosity=normal .\RabbitMQDotNetClient.sln | ||
dotnet run --verbosity=normal --project .\projects\Apigen\Apigen.csproj --apiName:AMQP_0_9_1 .\projects\specs\amqp0-9-1.stripped.xml .\gensrc\autogenerated-api-0-9-1.cs | ||
dotnet build --verbosity=normal .\RabbitMQDotNetClient.sln |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
$ProgressPreference = 'Continue' | ||
$ErrorActionPreference = 'Stop' | ||
Set-StrictMode -Version 2.0 | ||
|
||
$erlang_reg_path = 'HKLM:\SOFTWARE\Ericsson\Erlang' | ||
if (Test-Path 'HKLM:\SOFTWARE\WOW6432Node\') | ||
{ | ||
$erlang_reg_path = 'HKLM:\SOFTWARE\WOW6432Node\Ericsson\Erlang' | ||
} | ||
$erlang_erts_version = Get-ChildItem -Path $erlang_reg_path -Name | ||
$erlang_home = (Get-ItemProperty -LiteralPath $erlang_reg_path\$erlang_erts_version).'(default)' | ||
|
||
Write-Host "[INFO] Setting ERLANG_HOME to '$erlang_home'..." | ||
$env:ERLANG_HOME = $erlang_home | ||
[Environment]::SetEnvironmentVariable('ERLANG_HOME', $erlang_home, 'Machine') | ||
|
||
$regPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\RabbitMQ' | ||
if (Test-Path 'HKLM:\SOFTWARE\WOW6432Node\') | ||
{ | ||
$regPath = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\RabbitMQ' | ||
} | ||
|
||
$rabbitmq_base_path = Split-Path -Parent (Get-ItemProperty $regPath 'UninstallString').UninstallString | ||
$rabbitmq_version = (Get-ItemProperty $regPath "DisplayVersion").DisplayVersion | ||
$rabbitmqctl_path = Join-Path -Path $rabbitmq_base_path -ChildPath "rabbitmq_server-$rabbitmq_version" | Join-Path -ChildPath 'sbin' | Join-Path -ChildPath 'rabbitmqctl.bat' | ||
|
||
Write-Host "[INFO] Setting RABBITMQ_RABBITMQCTL_PATH to '$rabbitmqctl_path'..." | ||
$env:RABBITMQ_RABBITMQCTL_PATH = $rabbitmqctl_path | ||
[Environment]::SetEnvironmentVariable('RABBITMQ_RABBITMQCTL_PATH', $rabbitmqctl_path, 'Machine') | ||
|
||
$solution_file = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'RabbitMQDotNetClient.sln' | ||
dotnet test --no-restore --no-build --logger "console;verbosity=detailed" $solution_file |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"erlang": "24.2.1", | ||
"rabbitmq": "3.9.13" | ||
} |