Skip to content

Commit

Permalink
Merge pull request #63 from max-ieremenko/release/1.4.1
Browse files Browse the repository at this point in the history
Release/1.4.1
  • Loading branch information
max-ieremenko authored Jan 8, 2022
2 parents 53bc24e + 86994f6 commit aeb1cfc
Show file tree
Hide file tree
Showing 165 changed files with 2,865 additions and 1,942 deletions.
91 changes: 45 additions & 46 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ on:
- 'release/**'
paths-ignore:
- 'docs/**'
- 'Examples/**'
- '**.md'
pull_request:
branches:
- master
- 'release/**'
paths-ignore:
- 'docs/**'
- 'Examples/**'
- '**.md'

jobs:
Expand All @@ -38,41 +36,13 @@ jobs:
shell: cmd
run: dotnet tool install --global ThirdPartyLibraries.GlobalTool

- name: Install psake
- name: Install InvokeBuild
shell: pwsh
run: Install-Module -Name psake -RequiredVersion 4.9.0 -Force
run: Install-Module -Name InvokeBuild -RequiredVersion 5.8.6 -Force

- name: Build
shell: pwsh
run: .\Build\step-build.ps1

- name: ThirdPartyNotices
shell: pwsh
run: .\Build\step-third-party-notices.ps1

- name: Unit test net461
shell: pwsh
run: .\Build\step-unit-test.ps1 net461

- name: Unit test netcoreapp3.1
shell: pwsh
run: .\Build\step-unit-test.ps1 netcoreapp3.1

- name: Unit test net5.0
shell: pwsh
run: .\Build\step-unit-test.ps1 net5.0

- name: Unit test net6.0
shell: pwsh
run: .\Build\step-unit-test.ps1 net6.0

- name: Pack
shell: pwsh
run: .\Build\step-pack.ps1

- name: Pack test
shell: pwsh
run: .\Build\step-pack-test.ps1
run: Invoke-Build -File .\Build\ci-win-build-tasks.ps1

- name: Artifact nuget packages
uses: actions/upload-artifact@v2
Expand All @@ -83,7 +53,7 @@ jobs:
.\build-out\*.snupkg
if-no-files-found: error

sdk-test:
sdk-test-linux:
name: linux-sdk-test
runs-on: ubuntu-latest
needs: build
Expand All @@ -100,25 +70,54 @@ jobs:
run: ls -R
working-directory: build-out

- name: Install psake
- name: Install dotnet sdk
shell: pwsh
run: Install-Module -Name psake -RequiredVersion 4.9.0 -Force
run: .\Build\step-install-dotnet.ps1

- name: Dotnet info
shell: pwsh
run: dotnet --info

- name: test Basic
- name: Install InvokeBuild
shell: pwsh
run: .\Build\step-sdk-test-basic-github.ps1
run: Install-Module -Name InvokeBuild -RequiredVersion 5.8.6 -Force

- name: Test
shell: pwsh
run: Invoke-Build -File .\Build\ci-linux-sdk-tasks.ps1

sdk-test-win:
name: win-sdk-test
runs-on: windows-latest
needs: build

steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: nuget-packages
path: build-out

- name: List artifacts
run: ls -R
working-directory: build-out

- name: Install dotnet sdk
shell: pwsh
run: .\Build\step-install-dotnet.ps1

- name: Dotnet info
shell: pwsh
run: dotnet --info

- name: test ServerFilters
- name: Install InvokeBuild
shell: pwsh
run: .\Build\step-sdk-test-serverfilters-github.ps1
run: Install-Module -Name InvokeBuild -RequiredVersion 5.8.6 -Force

- name: test MessagePack
- name: Test
shell: pwsh
run: .\Build\step-sdk-test-messagepack-github.ps1
run: Invoke-Build -File .\Build\ci-win-sdk-tasks.ps1

benchmarks:
name: linux-benchmarks
Expand All @@ -127,9 +126,9 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install psake
- name: Install InvokeBuild
shell: pwsh
run: Install-Module -Name psake -RequiredVersion 4.9.0 -Force
run: Install-Module -Name InvokeBuild -RequiredVersion 5.8.6 -Force

- name: Install dotnet sdk
shell: pwsh
Expand All @@ -141,13 +140,13 @@ jobs:

- name: run benchmarks
shell: pwsh
run: .\Build\step-benchmarks-github.ps1
run: Invoke-Build -File .\Build\step-benchmarks-ci.ps1

- name: Artifact results
uses: actions/upload-artifact@v2
with:
name: benchmark-results
path: |
./BenchmarkDotNet.Artifacts/results
./BenchmarkDotNet.Artifacts
if-no-files-found: error

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Build/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Build

The repository is configured to run [CI build](https://github.com/max-ieremenko/test/actions) on any push or pull request into the master branch.
The repository is configured to run [CI build](https://github.com/max-ieremenko/ServiceModel.Grpc/actions) on any push or pull request into the master/release branch.

## Local build

To run CI build locally

- install [psake](https://www.powershellgallery.com/packages/psake)
- install [InvokeBuild](https://www.powershellgallery.com/packages/InvokeBuild)

``` powershell
PS> Install-Module -Name psake -RequiredVersion 4.9.0
PS> Install-Module -Name InvokeBuild -RequiredVersion 5.8.6
```
- install net6.0 sdk: manual [download](https://dotnet.microsoft.com/download/dotnet/6.0) or
Expand Down
90 changes: 44 additions & 46 deletions Build/build-locally-tasks.ps1
Original file line number Diff line number Diff line change
@@ -1,74 +1,72 @@
Task default -Depends Clean, Init, Build, ThirdPartyNotices, UnitTest, Pack, PackTest, SdkTest, Benchmarks
Task UnitTest -Depends UnitTest461, UnitTestCore31, UnitTestNet50, UnitTestNet60
Task SdkTest -Depends SdkTestBasic, SdkTestServerFilters, SdkTestMessagePack

Task Clean {
$dir = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..\build-out"))
if (Test-Path $dir) {
Remove-Item -Path $dir -Recurse -Force
. (Join-Path $PSScriptRoot "scripts/Import-All.ps1")

Enter-Build {
$settings = @{
build = Get-FullPath $PSScriptRoot;
sources = Get-FullPath (Join-Path $PSScriptRoot "..\Sources");
examples = Get-FullPath (Join-Path $PSScriptRoot "..\Examples");
benchmarks = Get-FullPath (Join-Path $PSScriptRoot "..\Benchmarks");
buildOut = Get-FullPath (Join-Path $PSScriptRoot "..\build-out");
thirdParty = Get-FullPath (Join-Path $PSScriptRoot "third-party-libraries");
}
}

$dir = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..\Sources"))
Get-ChildItem -Path $dir -Filter bin -Directory -Recurse | Remove-Item -Recurse -Force
Get-ChildItem -Path $dir -Filter obj -Directory -Recurse | Remove-Item -Recurse -Force
task Default Clean, Init, Build, ThirdPartyNotices, UnitTest, Pack, PackTest, SdkTest, Benchmarks
task UnitTest UnitTest461, UnitTestCore31, UnitTestNet50, UnitTestNet60

$dir = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..\Examples"))
Get-ChildItem -Path $dir -Filter bin -Directory -Recurse | Remove-Item -Recurse -Force
Get-ChildItem -Path $dir -Filter obj -Directory -Recurse | Remove-Item -Recurse -Force
task Clean {
Remove-DirectoryRecurse -Path $settings.buildOut

$dir = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..\Benchmarks"))
Get-ChildItem -Path $dir -Filter bin -Directory -Recurse | Remove-Item -Recurse -Force
Get-ChildItem -Path $dir -Filter obj -Directory -Recurse | Remove-Item -Recurse -Force
}
Remove-DirectoryRecurse -Path $settings.sources -Filters "bin", "obj"
Remove-DirectoryRecurse -Path $settings.examples -Filters "bin", "obj"
Remove-DirectoryRecurse -Path $settings.benchmarks -Filters "bin", "obj"

Task Init {
$env:GITHUB_SHA = Exec { git rev-parse HEAD }
Get-ChildItem -Path (Join-Path $env:USERPROFILE ".nuget\packages") -Filter "servicemodel.grpc*" -Directory | Remove-Item -Force -Recurse
}

Task Build {
Exec { .\step-build.ps1 }
task Init {
$env:GITHUB_SHA = exec { git rev-parse HEAD }
}

Task UnitTest461 {
Exec { .\step-unit-test.ps1 -Framework net461 }
task Build {
Invoke-Build -File "step-build.ps1" -Settings $settings
}

Task UnitTestCore31 {
Exec { .\step-unit-test.ps1 -Framework netcoreapp3.1 }
task UnitTest461 {
Invoke-Build -File "step-unit-test.ps1" -Settings $settings -Framework net461
}

Task UnitTestNet50 {
Exec { .\step-unit-test.ps1 -Framework net5.0 }
task UnitTestCore31 {
Invoke-Build -File "step-unit-test.ps1" -Settings $settings -Framework netcoreapp3.1
}

Task UnitTestNet60 {
Exec { .\step-unit-test.ps1 -Framework net6.0 }
task UnitTestNet50 {
Invoke-Build -File "step-unit-test.ps1" -Settings $settings -Framework net5.0
}

Task ThirdPartyNotices {
Exec { .\step-third-party-notices.ps1 }
task UnitTestNet60 {
Invoke-Build -File "step-unit-test.ps1" -Settings $settings -Framework net6.0
}

Task Pack {
Exec { .\step-pack.ps1 }
task ThirdPartyNotices {
Invoke-Build -File "step-third-party-notices.ps1" -Settings $settings
}

Task PackTest {
Exec { .\step-pack-test.ps1 }
task Pack {
Invoke-Build -File "step-pack.ps1" -Settings $settings
}

Task SdkTestBasic {
Exec { .\step-sdk-test-basic-locally.ps1 }
task PackTest {
Invoke-Build -File "step-pack-test.ps1" -Settings $settings
}

Task SdkTestServerFilters {
Exec { .\step-sdk-test-serverfilters-locally.ps1 }
}

Task SdkTestMessagePack {
Exec { .\step-sdk-test-messagepack-locally.ps1 }
task SdkTest {
$tests = Get-ChildItem -Path (Join-Path $settings.build sdk-test) -Filter "*-locally.ps1" | ForEach-Object {$_.FullName}
foreach ($test in $tests) {
Invoke-Build -File $test -Settings $settings
}
}

Task Benchmarks {
Exec { .\step-benchmarks-locally.ps1 }
task Benchmarks {
Invoke-Build -File "step-benchmarks-locally.ps1" -Settings $settings
}
11 changes: 7 additions & 4 deletions Build/build-locally.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#Install-Module -Name psake
#Requires -Modules @{ModuleName='psake'; RequiredVersion='4.9.0'}
#Install-Module -Name InvokeBuild -RequiredVersion 5.8.6
#Requires -Modules @{ ModuleName="InvokeBuild"; RequiredVersion="5.8.6" }

$psakeMain = Join-Path $PSScriptRoot "build-locally-tasks.ps1"
Invoke-psake $psakeMain
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

$main = Join-Path $PSScriptRoot "build-locally-tasks.ps1"
Invoke-Build -File $main
38 changes: 38 additions & 0 deletions Build/ci-linux-sdk-tasks.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
. (Join-Path $PSScriptRoot "scripts/Import-All.ps1")

Enter-Build {
$settings = @{
build = Get-FullPath $PSScriptRoot;
sources = Get-FullPath (Join-Path $PSScriptRoot "../Sources");
examples = Get-FullPath (Join-Path $PSScriptRoot "../Examples");
buildOut = Get-FullPath (Join-Path $PSScriptRoot "../build-out");
}
}

task Default Init, JustBuild, BuildAndRun

task Init {
exec { dotnet nuget add source $settings.buildOut }
}

task JustBuild {
$examples = @(
"CreateClientAndServerASPNETCore"
, "grpc-dotnet-Compressor"
, "grpc-dotnet-Counter"
, "grpc-dotnet-Interceptor"
, "JsonWebTokenAuthentication"
, "Swagger\NSwagSwagger.sln"
, "Swagger\SwashbuckleSwagger.sln")

foreach ($example in $examples) {
Invoke-Build -File "sdk-test/just-build.ps1" -Settings $settings -Example $example
}
}

task BuildAndRun {
$tests = Get-ChildItem -Path (Join-Path $settings.build sdk-test) -Filter "*-ci-linux.ps1" | ForEach-Object {$_.FullName}
foreach ($test in $tests) {
Invoke-Build -File $test -Settings $settings
}
}
Loading

0 comments on commit aeb1cfc

Please sign in to comment.