Skip to content

Merge pull request #428 from rpgrca/dependabot/nuget/TicTacToe/xunit.… #1628

Merge pull request #428 from rpgrca/dependabot/nuget/TicTacToe/xunit.…

Merge pull request #428 from rpgrca/dependabot/nuget/TicTacToe/xunit.… #1628

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Install dependencies
run: dotnet restore
- name: Install tools
run: dotnet tool install --global coverlet.console
- name: Restore packages
run: |
dotnet restore
for s in BowlingGame FizzBuzz MarsRover PasswordVerifier ScoreKeeper TicTacToe Wardrobe InventoryManager DrugSafetyAnalyzer ProductPricing; do
dotnet restore $s/$s.sln
done
- name: Build solutions
run: |
dotnet build --configuration Debug --no-restore
for s in BowlingGame FizzBuzz MarsRover PasswordVerifier ScoreKeeper TicTacToe Wardrobe InventoryManager DrugSafetyAnalyzer ProductPricing; do
dotnet build --configuration Debug --no-restore $s/$s.sln
done
- name: Testing NET programs
run: |
for s in BowlingGame FizzBuzz MarsRover PasswordVerifier ScoreKeeper TicTacToe Wardrobe; do
coverlet $s/$s.Core.UnitTests/bin/Debug/net7/$s.Core.UnitTests.dll --target "dotnet" --targetargs "test $s/$s.Core.UnitTests/$s.Core.UnitTests.csproj --no-build --verbosity quiet" --format OpenCover --output $s.coverage.xml
done
for s in InventoryManager DrugSafetyAnalyzer ProductPricing; do
coverlet $s/test/bin/Debug/net7.0/$s.UnitTests.dll --target "dotnet" --targetargs "test $s/test/$s.UnitTests.csproj --no-build --verbosity quiet" --format OpenCover --output $s.coverage.xml
done
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ./*.coverage.xml