Skip to content

Commit

Permalink
Huge build project refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyAkinshin committed Jul 5, 2023
1 parent 144f5c5 commit 6291a7e
Show file tree
Hide file tree
Showing 32 changed files with 1,437 additions and 870 deletions.
125 changes: 104 additions & 21 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,115 @@ on:
pull_request:
push:

permissions: write-all

jobs:
build-windows:

build-windows-core:
runs-on: windows-latest
steps:
- name: Disable Windows Defender
run: Set-MpPreference -DisableRealtimeMonitoring $true
shell: powershell
- uses: actions/checkout@v3
- name: Run task 'Build'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd Build
- name: Run task 'InTestsCore'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd InTestsCore -e
- name: Upload test results
uses: actions/upload-artifact@v2
if: always()
with:
name: build-windows-core-trx
path: "**/*.trx"

build-windows-full:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Run
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.bat
- name: Disable Windows Defender
run: Set-MpPreference -DisableRealtimeMonitoring $true
shell: powershell
- uses: actions/checkout@v3
- name: Run task 'Build'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd Build
- name: Run task 'InTestsFull'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
./build.cmd InTestsFull -e
- name: Upload test results
uses: actions/upload-artifact@v2
if: always()
with:
name: build-windows-full-trx
path: "**/*.trx"

build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- name: Set up zlib-static
run: sudo apt-get install -y libkrb5-dev
- name: Run
run: ./build.sh
- uses: actions/checkout@v3
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- name: Set up zlib-static
run: sudo apt-get install -y libkrb5-dev
- name: Run task 'Build'
run: ./build.cmd Build
- name: Run task 'UnitTests'
run: ./build.cmd UnitTests -e
- name: Run task 'InTestsCore'
run: ./build.cmd InTestsCore -e
- name: Upload test results
uses: actions/upload-artifact@v2
if: always()
with:
name: build-linux-trx
path: "**/*.trx"

build-macos:
runs-on: macOS-latest
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Run task 'Build'
run: ./build.cmd Build
- name: Run task 'UnitTests'
run: ./build.cmd UnitTests -e
- name: Run task 'InTestsCore'
run: ./build.cmd InTestsCore -e
- name: Upload test results
uses: actions/upload-artifact@v2
if: always()
with:
name: build-macos-trx
path: "**/*.trx"

report:
concurrency: ci-${{ github.ref }}
needs: [build-windows-full, build-windows-core, build-linux, build-macos]
runs-on: ubuntu-latest
if: always()
steps:
- uses: actions/checkout@v3
- name: Run
run: ./build.sh
- uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Report tests results
uses: dorny/test-reporter@v1
if: always()
with:
name: test-results
path: "**/*.trx"
reporter: dotnet-trx
fail-on-error: true
2 changes: 1 addition & 1 deletion .github/workflows/docs-changelog-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
ref: master

- name: Download changelog
run: ./build.sh --target DocFX_Changelog_Download --VersionCount 1
run: ./build.cmd DocsUpdate /p:Depth=1
env:
GITHUB_PRODUCT: ChangelogBuilder
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
ref: docs-stable

- name: Build BenchmarkDotNet
run: ./build.bat --target Build
run: ./build.cmd Build

- name: Download changelog
run: ./build.bat --target DocFX_Changelog_Download --VersionCount 1
run: ./build.cmd DocsUpdate /p:Depth=1
env:
GITHUB_PRODUCT: ChangelogBuilder
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build documentation
run: ./build.bat --target DocFX_Build
run: ./build.cmd DocsBuild

- name: Upload Artifacts
uses: actions/upload-artifact@v1
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/publish-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: publish-nightly

on:
push:
branches:
- master

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Pack
run: ./build.cmd pack /p:VersionSuffix=nightly.$DATE.$GITHUB_RUN_NUMBER
- name: Publish nupkg
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
run: .dotnet/dotnet nuget push **/*.nupkg --source https://www.myget.org/F/benchmarkdotnet/api/v3/index.json --api-key $MYGET_API_KEY --timeout 600
- name: Publish snupkg
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
run: .dotnet/dotnet nuget push **/*.snupkg --source https://www.myget.org/F/benchmarkdotnet/api/v3/index.json --api-key $MYGET_API_KEY --timeout 600
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ before_build:
#---------------------------------#

build_script:
- ps: .\build.ps1
- ps: .\build.cmd CI

test: off
deploy: off
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
parameters:
name: Ubuntu
vmImage: 'ubuntu-20.04'
scriptFileName: ./build.sh
scriptFileName: ./build.cmd CI
initialization:
- bash: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
parameters:
name: Windows
vmImage: 'windows-2019'
scriptFileName: .\build.ps1
scriptFileName: .\build.cmd CI
2 changes: 1 addition & 1 deletion azure-pipelines.macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
parameters:
name: macOS
vmImage: 'macOS-latest'
scriptFileName: ./build.sh
scriptFileName: ./build.cmd CI
5 changes: 5 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:<<"::CMDLITERAL"
@CALL build\build.bat %*
@GOTO :EOF
::CMDLITERAL
"$(cd "$(dirname "$0")"; pwd)/build/build.sh" "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="3.0.0" />
<PackageReference Include="Cake.FileHelpers" Version="6.1.3" />
<PackageReference Include="Cake.Git" Version="3.0.0" />
<PackageReference Include="Microsoft.DocAsCode.App" Version="2.67.5" />
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
<PackageReference Include="Octokit" Version="7.0.0" />
</ItemGroup>
</Project>
Loading

0 comments on commit 6291a7e

Please sign in to comment.