Skip to content

Commit

Permalink
more build
Browse files Browse the repository at this point in the history
  • Loading branch information
DanHarltey committed Jan 17, 2024
1 parent 6e8a773 commit 0a08a54
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ jobs:

- name: Run build script
working-directory: scripts
run: ./dotnet_build.sh code_coverage
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
./dotnet_build.sh code_coverage
else
./dotnet_build.sh
fi
17 changes: 11 additions & 6 deletions scripts/dotnet_build.sh
Original file line number Diff line number Diff line change
@@ -1,20 +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 {} ../coverage.net8.info \;
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 {} ../coverage.net48.info \;

ls
ls ..
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
dotnet pack ../ --configuration Release --no-build

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 \;

0 comments on commit 0a08a54

Please sign in to comment.