Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
DanHarltey committed Jan 16, 2024
1 parent c015bfe commit 734b74a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,54 @@ jobs:
steps:
- name: GIT checkout
uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test net8.0
run: dotnet test --configuration Release --no-build --verbosity normal --framework net8.0 --collect:"XPlat Code Coverage;Format=lcov"

- name: Copy test coverage file
run: Get-Childitem –Path ".\tests\Fastenshtein.Tests\TestResults\" -Include "coverage.info" -File -Recurse | Move-Item -Destination "coverage.net8.info"

- name: Test net48
run: dotnet test --configuration Release --no-build --verbosity normal --framework net48 --collect:"XPlat Code Coverage;Format=lcov"

- name: Copy test coverage file
run: Get-Childitem –Path ".\tests\Fastenshtein.Tests\TestResults\" -Include "coverage.info" -File -Recurse | Move-Item -Destination coverage.net48.info

- name: Upload test coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
format: lcov
files: coverage.net8.info coverage.net48.info

- name: Pack
run: dotnet pack --configuration Release --no-build --nologo
- name: Upload Artifact

- name: Upload NuGet package artifact
uses: actions/upload-artifact@v4
with:
name: Fastenshtein
path: src\Fastenshtein\bin\Release\Fastenshtein.*.*upkg

- name: Upload code coverage report artifact
uses: actions/upload-artifact@v4
with:
name: Code Coverage
path: coverage.*.info

- name: Run benchmark
run: .\benchmarks\Fastenshtein.Benchmarking\bin\Release\net8.0\Fastenshtein.Benchmarking.exe

- name: Upload benchmarks-results to Artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 5 additions & 1 deletion scripts/dotnet_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ dotnet restore ../
dotnet build ../ --configuration Release --no-restore /p:ContinuousIntegrationBuild=true

if [[ $1 = "code_coverage" ]]; then
dotnet test ../ --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage;Format=lcov"
dotnet test ../ --configuration Release --no-build --verbosity normal --framework net8.0 --collect:"XPlat Code Coverage;Format=lcov"
find -name "coverage.info" -type f -exec mv {} ../coverage.net8.info \;

dotnet test ../ --configuration Release --no-build --verbosity normal --framework net48 --collect:"XPlat Code Coverage;Format=lcov"
find -name "coverage.info" -type f -exec mv {} ../coverage.net48.info \;
else
dotnet test ../ --configuration Release --no-build --verbosity normal
fi
Expand Down
5 changes: 2 additions & 3 deletions scripts/github_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ mkdir ../release

dotnet --info > ../release/dotnet_info.txt

find ../tests/Fastenshtein.Tests/TestResults -name coverage.info -exec cp "{}" ../release \;

find ../src/Fastenshtein/bin/Release -name "Fastenshtein.*.nupkg" -exec cp "{}" ../release/Fastenshtein.nupkg \;
find ../src/Fastenshtein/bin/Release -name "Fastenshtein.*.snupkg" -exec cp "{}" ../release/Fastenshtein.snupkg \;

gh release create $1 \
"../release/Fastenshtein.nupkg" \
"../release/Fastenshtein.snupkg" \
"../release/coverage.info#Code coverage report" \
"../coverage.net48.info#Code coverage report net48" \
"../coverage.net8.info#Code coverage report net8" \
"../release/dotnet_info.txt#Built with" \
--draft \
--generate-notes

0 comments on commit 734b74a

Please sign in to comment.