Skip to content

Commit 6cb423a

Browse files
Huge build project refactoring
1 parent 144f5c5 commit 6cb423a

32 files changed

+1437
-902
lines changed

.github/workflows/build.yaml

+104-21
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,115 @@ on:
44
pull_request:
55
push:
66

7+
permissions: write-all
8+
79
jobs:
8-
build-windows:
10+
11+
build-windows-core:
12+
runs-on: windows-latest
13+
steps:
14+
- name: Disable Windows Defender
15+
run: Set-MpPreference -DisableRealtimeMonitoring $true
16+
shell: powershell
17+
- uses: actions/checkout@v3
18+
- name: Run task 'Build'
19+
shell: cmd
20+
run: |
21+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
22+
./build.cmd Build
23+
- name: Run task 'InTestsCore'
24+
shell: cmd
25+
run: |
26+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
27+
./build.cmd InTestsCore -e
28+
- name: Upload test results
29+
uses: actions/upload-artifact@v2
30+
if: always()
31+
with:
32+
name: build-windows-core-trx
33+
path: "**/*.trx"
34+
35+
build-windows-full:
936
runs-on: windows-latest
1037
steps:
11-
- uses: actions/checkout@v3
12-
- name: Run
13-
shell: cmd
14-
run: |
15-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
16-
./build.bat
38+
- name: Disable Windows Defender
39+
run: Set-MpPreference -DisableRealtimeMonitoring $true
40+
shell: powershell
41+
- uses: actions/checkout@v3
42+
- name: Run task 'Build'
43+
shell: cmd
44+
run: |
45+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
46+
./build.cmd Build
47+
- name: Run task 'InTestsFull'
48+
shell: cmd
49+
run: |
50+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
51+
./build.cmd InTestsFull -e
52+
- name: Upload test results
53+
uses: actions/upload-artifact@v2
54+
if: always()
55+
with:
56+
name: build-windows-full-trx
57+
path: "**/*.trx"
58+
1759
build-linux:
1860
runs-on: ubuntu-latest
1961
steps:
20-
- uses: actions/checkout@v3
21-
- name: Set up Clang
22-
uses: egor-tensin/setup-clang@v1
23-
with:
24-
version: latest
25-
platform: x64
26-
- name: Set up zlib-static
27-
run: sudo apt-get install -y libkrb5-dev
28-
- name: Run
29-
run: ./build.sh
62+
- uses: actions/checkout@v3
63+
- name: Set up Clang
64+
uses: egor-tensin/setup-clang@v1
65+
with:
66+
version: latest
67+
platform: x64
68+
- name: Set up zlib-static
69+
run: sudo apt-get install -y libkrb5-dev
70+
- name: Run task 'Build'
71+
run: ./build.cmd Build
72+
- name: Run task 'UnitTests'
73+
run: ./build.cmd UnitTests -e
74+
- name: Run task 'InTestsCore'
75+
run: ./build.cmd InTestsCore -e
76+
- name: Upload test results
77+
uses: actions/upload-artifact@v2
78+
if: always()
79+
with:
80+
name: build-linux-trx
81+
path: "**/*.trx"
82+
3083
build-macos:
31-
runs-on: macOS-latest
84+
runs-on: macos-13
85+
steps:
86+
- uses: actions/checkout@v3
87+
- name: Run task 'Build'
88+
run: ./build.cmd Build
89+
- name: Run task 'UnitTests'
90+
run: ./build.cmd UnitTests -e
91+
- name: Run task 'InTestsCore'
92+
run: ./build.cmd InTestsCore -e
93+
- name: Upload test results
94+
uses: actions/upload-artifact@v2
95+
if: always()
96+
with:
97+
name: build-macos-trx
98+
path: "**/*.trx"
99+
100+
report:
101+
concurrency: ci-${{ github.ref }}
102+
needs: [build-windows-full, build-windows-core, build-linux, build-macos]
103+
runs-on: ubuntu-latest
104+
if: always()
32105
steps:
33-
- uses: actions/checkout@v3
34-
- name: Run
35-
run: ./build.sh
106+
- uses: actions/checkout@v3
107+
- name: Download Artifacts
108+
uses: actions/download-artifact@v3
109+
- name: Display structure of downloaded files
110+
run: ls -R
111+
- name: Report tests results
112+
uses: dorny/test-reporter@v1
113+
if: always()
114+
with:
115+
name: test-results
116+
path: "**/*.trx"
117+
reporter: dotnet-trx
118+
fail-on-error: true

.github/workflows/docs-changelog-generate.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
ref: master
2020

2121
- name: Download changelog
22-
run: ./build.sh --target DocFX_Changelog_Download --VersionCount 1
22+
run: ./build.cmd DocsUpdate /p:Depth=1
2323
env:
2424
GITHUB_PRODUCT: ChangelogBuilder
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs-stable.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ jobs:
1919
ref: docs-stable
2020

2121
- name: Build BenchmarkDotNet
22-
run: ./build.bat --target Build
22+
run: ./build.cmd Build
2323

2424
- name: Download changelog
25-
run: ./build.bat --target DocFX_Changelog_Download --VersionCount 1
25+
run: ./build.cmd DocsUpdate /p:Depth=1
2626
env:
2727
GITHUB_PRODUCT: ChangelogBuilder
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929

3030
- name: Build documentation
31-
run: ./build.bat --target DocFX_Build
31+
run: ./build.cmd DocsBuild
3232

3333
- name: Upload Artifacts
3434
uses: actions/upload-artifact@v1
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: publish-nightly
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
main:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set date
14+
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
15+
- name: Pack
16+
run: ./build.cmd pack /p:VersionSuffix=nightly.$DATE.$GITHUB_RUN_NUMBER
17+
- name: Publish nupkg
18+
env:
19+
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
20+
run: .dotnet/dotnet nuget push **/*.nupkg --source https://www.myget.org/F/benchmarkdotnet/api/v3/index.json --api-key $MYGET_API_KEY --timeout 600
21+
- name: Publish snupkg
22+
env:
23+
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
24+
run: .dotnet/dotnet nuget push **/*.snupkg --source https://www.myget.org/F/benchmarkdotnet/api/v3/index.json --api-key $MYGET_API_KEY --timeout 600

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ before_build:
3737
#---------------------------------#
3838

3939
build_script:
40-
- ps: .\build.ps1
40+
- ps: .\build.cmd CI
4141

4242
test: off
4343
deploy: off

azure-pipelines.Ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
parameters:
1414
name: Ubuntu
1515
vmImage: 'ubuntu-20.04'
16-
scriptFileName: ./build.sh
16+
scriptFileName: ./build.cmd CI
1717
initialization:
1818
- bash: |
1919
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -

azure-pipelines.Windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
parameters:
1414
name: Windows
1515
vmImage: 'windows-2019'
16-
scriptFileName: .\build.ps1
16+
scriptFileName: .\build.cmd CI

azure-pipelines.macOS.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
parameters:
1414
name: macOS
1515
vmImage: 'macOS-latest'
16-
scriptFileName: ./build.sh
16+
scriptFileName: ./build.cmd CI

build.cmd

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:<<"::CMDLITERAL"
2+
@CALL build\build.bat %*
3+
@GOTO :EOF
4+
::CMDLITERAL
5+
"$(cd "$(dirname "$0")"; pwd)/build/build.sh" "$@"

build/Build.csproj build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net7.0</TargetFramework>
55
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
6+
<Nullable>enable</Nullable>
67
</PropertyGroup>
78
<ItemGroup>
89
<PackageReference Include="Cake.Frosting" Version="3.0.0" />
910
<PackageReference Include="Cake.FileHelpers" Version="6.1.3" />
1011
<PackageReference Include="Cake.Git" Version="3.0.0" />
1112
<PackageReference Include="Microsoft.DocAsCode.App" Version="2.67.5" />
12-
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
1313
<PackageReference Include="Octokit" Version="7.0.0" />
1414
</ItemGroup>
1515
</Project>

0 commit comments

Comments
 (0)