-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading supporting test & benchmarks to .Net 8.
Upgrading GitHub action steps to latest. Reducing build complexity. New build to create GitHub release. Now using deterministic build Added SourceLink Added Symbols package on pack
- Loading branch information
1 parent
4f83ecc
commit ba9513e
Showing
12 changed files
with
194 additions
and
108 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 |
---|---|---|
@@ -1,73 +1,73 @@ | ||
name: GitHub action build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
on: push | ||
|
||
jobs: | ||
Main-build_windows: | ||
|
||
runs-on: windows-latest | ||
main-build: | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET 5 | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.x | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
- name: Test | ||
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults /p:CoverletOutputFormat=lcov | ||
- name: Upload net5.0 unit test code coverage to Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: .\tests\Fastenshtein.Tests\TestResults.net5.0.info | ||
- name: Upload net48 unit test code coverage to Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: .\tests\Fastenshtein.Tests\TestResults.net48.info | ||
- name: Pack | ||
run: dotnet pack --configuration Release --no-build --no-restore --nologo | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Fastenshtein.nupkg | ||
path: src\Fastenshtein\bin\Release\Fastenshtein.*.nupkg | ||
- name: Run benchmark | ||
run: .\benchmarks\Fastenshtein.Benchmarking\bin\Release\net5.0\Fastenshtein.Benchmarking.exe | ||
- name: Upload benchmarks-results to Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: benchmarks-results-windows-latest | ||
path: BenchmarkDotNet.Artifacts | ||
|
||
benchmarks: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET 5 | ||
uses: actions/setup-dotnet@v1 | ||
- name: GIT checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET 8 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 5.0.x | ||
- name: Run benchmarks script | ||
dotnet-version: 8.0.x | ||
|
||
- name: Run build script | ||
working-directory: scripts | ||
shell: bash | ||
run: | | ||
cd scripts | ||
./benchmark.sh | ||
- name: Upload benchmarks-results to Artifacts | ||
uses: actions/upload-artifact@v2 | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
./dotnet_build.sh code_coverage | ||
else | ||
./dotnet_build.sh | ||
fi | ||
- name: Run benchmarks | ||
working-directory: release | ||
shell: bash | ||
run: dotnet ../benchmarks/Fastenshtein.Benchmarking/bin/Release/net8.0/Fastenshtein.Benchmarking.dll | ||
|
||
- name: Upload benchmarks results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: benchmarks-results-${{ matrix.os }} | ||
path: scripts/BenchmarkDotNet.Artifacts | ||
path: release/BenchmarkDotNet.Artifacts | ||
if-no-files-found: error | ||
|
||
- name: Upload test coverage to Coveralls | ||
if: runner.os == 'Linux' | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
format: lcov | ||
files: release/coverage.net8.info release/coverage.net48.info | ||
|
||
- name: Upload dotnet info | ||
uses: actions/upload-artifact@v4 | ||
if: runner.os == 'Linux' | ||
with: | ||
name: Built with | ||
path: release/dotnet_info.txt | ||
if-no-files-found: error | ||
|
||
- name: Upload test coverage | ||
uses: actions/upload-artifact@v4 | ||
if: runner.os == 'Linux' | ||
with: | ||
name: test coverage | ||
path: release/coverage.*.info | ||
if-no-files-found: error | ||
|
||
- name: Upload NuGet packages | ||
uses: actions/upload-artifact@v4 | ||
if: runner.os == 'Linux' | ||
with: | ||
name: NuGet packages | ||
path: release/Fastenshtein.*upkg | ||
if-no-files-found: error |
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,35 @@ | ||
name: GitHub Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '1.*' | ||
|
||
jobs: | ||
build: | ||
name: Relase build | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | ||
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
DOTNET_NOLOGO: true | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET 8 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Run build script | ||
working-directory: scripts | ||
run: ./dotnet_build.sh code_coverage | ||
|
||
- name: Create GitHub release | ||
working-directory: scripts | ||
run: ./github_release.sh ${{ github.ref_name }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
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 |
---|---|---|
@@ -1,11 +1,28 @@ | ||
image: | ||
- Visual Studio 2019 | ||
- Visual Studio 2022 | ||
- Ubuntu | ||
- macOS | ||
install: | ||
- pwsh: | | ||
if ($isWindows) { | ||
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1" | ||
./dotnet-install.ps1 -InstallDir 'C:\Program Files\dotnet' | ||
} | ||
else { | ||
Invoke-WebRequest "https://dot.net/v1/dotnet-install.sh" -OutFile "./dotnet-install.sh" | ||
sudo chmod u+x dotnet-install.sh | ||
if ($isMacOS) { | ||
sudo ./dotnet-install.sh --install-dir '/usr/local/share/dotnet' | ||
} else { | ||
sudo ./dotnet-install.sh --install-dir '/usr/share/dotnet' | ||
} | ||
} | ||
build_script: | ||
- cd scripts | ||
- cmd: .\benchmark.bat | ||
- sh: ./benchmark.sh | ||
- cmd: bash -c "./dotnet_build.sh" | ||
- sh: ./dotnet_build.sh | ||
- dotnet ../benchmarks/Fastenshtein.Benchmarking/bin/Release/net8.0/Fastenshtein.Benchmarking.dll | ||
|
||
artifacts: | ||
- path: scripts/BenchmarkDotNet.Artifacts | ||
name: Benchmark results | ||
name: Benchmark results - $(APPVEYOR_BUILD_WORKER_IMAGE) |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
rm -rf ../release | ||
mkdir ../release | ||
|
||
dotnet --info > ../release/dotnet_info.txt | ||
|
||
dotnet restore ../ | ||
dotnet build ../ --configuration Release --no-restore -p:ContinuousIntegrationBuild=true | ||
|
||
if [[ $1 = "code_coverage" ]]; then | ||
dotnet test ../ --configuration Release --no-build --verbosity normal --framework net8.0 --collect:"XPlat Code Coverage;Format=lcov" | ||
find ../tests/Fastenshtein.Tests/TestResults/ -name "coverage.info" -type f -exec mv {} ../release/coverage.net8.info \; | ||
|
||
dotnet test ../ --configuration Release --no-build --verbosity normal --framework net48 --collect:"XPlat Code Coverage;Format=lcov" | ||
find ../tests/Fastenshtein.Tests/TestResults/ -name "coverage.info" -type f -exec mv {} ../release/coverage.net48.info \; | ||
else | ||
dotnet test ../ --configuration Release --no-build --verbosity normal | ||
fi | ||
|
||
dotnet pack ../ --configuration Release --no-build | ||
|
||
cp ../src/Fastenshtein/bin/Release/Fastenshtein.*.nupkg ../release/Fastenshtein.nupkg | ||
cp ../src/Fastenshtein/bin/Release/Fastenshtein.*.snupkg ../release/Fastenshtein.snupkg |
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,11 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
gh release create $1 \ | ||
"../release/Fastenshtein.nupkg" \ | ||
"../release/Fastenshtein.snupkg" \ | ||
"../release/coverage.net48.info#Code coverage report net48" \ | ||
"../release/coverage.net8.info#Code coverage report net8" \ | ||
"../release/dotnet_info.txt#Built with" \ | ||
--draft \ | ||
--generate-notes |
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
Oops, something went wrong.