1212
1313env :
1414 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
15- dotnet_sdk_version : ' 2.1.500'
1615 build_configuration : Release
1716
1817jobs :
1918 build-windows :
2019 runs-on : windows-latest
2120 steps :
2221 - uses : actions/checkout@v1
22+ - name : Install .NET Core
23+ shell : pwsh
24+ run : |
25+ $info = dotnet --info
26+ $isRuntime = $info -contains 'Microsoft.NETCore.App 2.1'
27+ Push-Location src; dotnet --version > $null; Pop-Location; $isSdk = $LASTEXITCODE -eq 0; $LASTEXITCODE = 0
28+ if ($isSdk -and $isRuntime) { return }
29+ [string]$dotnetroot = "~/.dotnet" | %{ if (-not (Test-Path $_)) { mkdir $_ > $null }; Resolve-Path $_ }
30+ Invoke-WebRequest "https://dotnetwebsite.azurewebsites.net/download/dotnet-core/scripts/v1/dotnet-install.ps1" -OutFile ~/dotnet-install.ps1
31+ ~/dotnet-install.ps1 -JsonFile src/global.json -InstallDir $dotnetroot
32+ ~/dotnet-install.ps1 -Channel 2.1 -Runtime dotnet -InstallDir $dotnetroot
33+ Write-Output "::add-path::$dotnetroot"
34+ Write-Output "::set-env name=DOTNET_ROOT::$dotnetroot"
2335 - name : Setup .NET Core
2436 uses : actions/setup-dotnet@v1
25- with :
26- dotnet-version : ${{ env.dotnet_sdk_version }}
2737 - run : dotnet --info
2838 - name : Install and run nbgv
2939 run : |
3242 - name : Restore
3343 run : dotnet restore src -v normal
3444 - name : Build
35- run : dotnet build src -t:build,pack --no-restore -m -c ${{ env.build_configuration }}
45+ run : dotnet build src -t:build,pack --no-restore -m -c ${{ env.build_configuration }} -bl:obj/logs/build-windows.binlog
3646 - name : Test
3747 run : dotnet test src --no-build -c ${{ env.build_configuration }}
3848 - name : Upload nugets
@@ -41,28 +51,48 @@ jobs:
4151 with :
4252 name : nugets
4353 path : bin/Packages/${{ env.build_configuration }}
54+ - name : Upload logs
55+ uses : actions/upload-artifact@v1
56+ with :
57+ name : logs-windows
58+ path : obj/logs/
4459
4560 build-other :
4661 strategy :
4762 matrix :
4863 os : [ubuntu-latest, macos-latest]
49- env :
50- project_path : ' src/CodeGeneration.Roslyn.Tests'
5164 runs-on : ${{ matrix.os }}
5265 steps :
5366 - uses : actions/checkout@v1
67+ - name : Install .NET Core
68+ shell : pwsh
69+ run : |
70+ $info = dotnet --info
71+ $isRuntime = $info -contains 'Microsoft.NETCore.App 2.1'
72+ Push-Location src; dotnet --version > $null; Pop-Location; $isSdk = $LASTEXITCODE -eq 0; $LASTEXITCODE = 0
73+ if ($isSdk -and $isRuntime) { return }
74+ [string]$dotnetroot = "~/.dotnet" | %{ if (-not (Test-Path $_)) { mkdir $_ > $null }; Resolve-Path $_ }
75+ Invoke-WebRequest "https://dotnetwebsite.azurewebsites.net/download/dotnet-core/scripts/v1/dotnet-install.sh" -OutFile ~/dotnet-install.sh
76+ chmod +x ~/dotnet-install.sh
77+ ~/dotnet-install.sh -JsonFile src/global.json -InstallDir $dotnetroot
78+ ~/dotnet-install.sh -Channel 2.1 -Runtime dotnet -InstallDir $dotnetroot
79+ Write-Output "::add-path::$dotnetroot"
80+ Write-Output "::set-env name=DOTNET_ROOT::$dotnetroot"
5481 - name : Setup .NET Core
5582 uses : actions/setup-dotnet@v1
56- with :
57- dotnet-version : ${{ env.dotnet_sdk_version }}
5883 - run : dotnet --info
5984 - name : Install and run nbgv
6085 run : |
61- dotnet tool install --tool-path . nbgv
86+ dotnet tool install --tool-path . nbgv --version 3.0.28
6287 ./nbgv get-version -p src
6388 - name : Restore
64- run : dotnet restore ${{ env.project_path }} -v normal
89+ run : dotnet restore src -v normal
6590 - name : Build
66- run : dotnet build ${{ env.project_path }} --no-restore -m -c ${{ env.build_configuration }} -f netcoreapp2.1
91+ run : dotnet build src --no-restore -m -c ${{ env.build_configuration }} -bl:obj/logs/build-${{ matrix.os }}.binlog
6792 - name : Test
68- run : dotnet test ${{ env.project_path }} --no-build -c ${{ env.build_configuration }} -f netcoreapp2.1
93+ run : dotnet test src --no-build -c ${{ env.build_configuration }} -f netcoreapp2.1
94+ - name : Upload logs
95+ uses : actions/upload-artifact@v1
96+ with :
97+ name : logs-${{ matrix.os }}
98+ path : obj/logs/
0 commit comments