Skip to content

Added tests

Added tests #110

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Test
run: dotnet test --verbosity normal --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura
- name: Build for netstandard2.0
run: dotnet build Motiv/Motiv.csproj --configuration Release --framework netstandard2.0 --no-restore -o ./Motiv/bin/Release/netstandard2.0/
- name: Build for net8.0
run: dotnet build Motiv/Motiv.csproj --configuration Release --framework net8.0 --no-restore -o ./Motiv/bin/Release/net8.0/
- name: List Build Artifacts
run: Get-ChildItem -Path .\Motiv\bin\Release\ -Recurse -Name
- name: Pack
run: dotnet pack Motiv/Motiv.csproj --configuration Release --no-build --output nupkgs
- name: List NuGet Packages
run: Get-ChildItem -Path .\nupkgs\ -Recurse -Name
- name: Publish to NuGet
run: dotnet nuget push "**/*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
if: github.ref == 'refs/heads/main'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}