Skip to content

Added images and more unit tests #3

Added images and more unit tests

Added images and more unit tests #3

Workflow file for this run

name: .NET
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
env:
ProjectName: SousVide
runs-on: windows-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Initialize test reporting
uses: testspace-com/setup-testspace@v1
with:
domain: ${{github.repository_owner}}
- name: Restore
run: dotnet restore --verbosity normal
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Pack
run: dotnet pack ${{ env.ProjectName }} --no-build --configuration Release --verbosity normal
- name: Test
run: |
dotnet test --no-build --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Tests/Tests.runsettings --logger "trx;LogFileName=TestResults.xml"
Out-File -InputObject "TEST_EXIT_CODE=$LASTEXITCODE" -FilePath $env:GITHUB_ENV -Append -Encoding UTF8
Copy-Item Tests/TestResults/*/coverage.info Tests/TestResults -ErrorAction Continue
exit 0
- name: Upload test report
run: testspace Tests/TestResults/TestResults.xml
- name: Upload coverage report
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: Tests/TestResults/coverage.info
format: lcov
- name: Stop if tests failed
run: exit $env:TEST_EXIT_CODE
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: ${{ env.ProjectName }}.nupkg
path: ${{ env.ProjectName }}/bin/Release/*.*nupkg
if-no-files-found: error
- name: Publish SousVideCtl
run: |
dotnet publish SousVideCtl -c Release --self-contained false -p:PublishSingleFile=true -r win-x64 -f net8.0-windows10.0.19041.0
dotnet publish SousVideCtl -c Release --self-contained false -p:PublishSingleFile=true -r win-arm64 -f net8.0-windows10.0.19041.0
dotnet publish SousVideCtl -c Release --self-contained false -p:PublishSingleFile=true -r linux-x64 -f net8.0
dotnet publish SousVideCtl -c Release --self-contained false -p:PublishSingleFile=true -r linux-arm -f net8.0
dotnet publish SousVideCtl -c Release --self-contained false -p:PublishSingleFile=true -r linux-arm64 -f net8.0
New-Item -Name SousVideCtl/bin/Release/upload/Windows -Type Directory -ErrorAction SilentlyContinue
New-Item -Name SousVideCtl/bin/Release/upload/Linux -Type Directory -ErrorAction SilentlyContinue
Copy-Item SousVideCtl/bin/Release/net8.0-windows10.0.19041.0/win-x64/publish/SousVideCtl.exe SousVideCtl/bin/Release/upload/Windows/SousVideCtl-x64.exe
Copy-Item SousVideCtl/bin/Release/net8.0-windows10.0.19041.0/win-arm64/publish/SousVideCtl.exe SousVideCtl/bin/Release/upload/Windows/SousVideCtl-ARM64.exe
Copy-Item SousVideCtl/bin/Release/net8.0/linux-x64/publish/sousvidectl SousVideCtl/bin/Release/upload/Linux/sousvidectl-x64
Copy-Item SousVideCtl/bin/Release/net8.0/linux-arm/publish/sousvidectl SousVideCtl/bin/Release/upload/Linux/sousvidectl-arm
Copy-Item SousVideCtl/bin/Release/net8.0/linux-arm64/publish/sousvidectl SousVideCtl/bin/Release/upload/Linux/sousvidectl-arm64
- name: Upload SousVideCtl
uses: actions/upload-artifact@v4
with:
name: SousVideCtl
path: SousVideCtl/bin/Release/upload/
if-no-files-found: error