Skip to content

Fix unit tests

Fix unit tests #1101

Workflow file for this run

name: CI
on: [push, pull_request]
env:
VERSION: "5.0.0.${{github.run_number}}"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Checkout code
uses: actions/[email protected]
- name: Download code signing certificate
uses: timheuer/[email protected]
with:
fileName: certificate.snk
fileDir: ${{ github.workspace }}
encodedString: ${{ secrets.SNC_BASE64 }}
- name: Build solution
run: dotnet build MQTTnet.sln --configuration Release /p:FileVersion=${{ env.VERSION }} /p:AssemblyVersion=${{ env.VERSION }} /p:PackageVersion=${{ env.VERSION }} /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=${{ github.workspace }}/certificate.snk
- name: Collect nuget packages
uses: actions/upload-artifact@v2
with:
name: nuget Packages
path: |
**/*.nupkg
**/*.snupkg
- name: Execute tests
run: dotnet test --no-restore --framework net8.0 Source/MQTTnet.Tests/MQTTnet.Tests.csproj
- name: Publish MyGet nugets
if: ${{ github.event_name == 'push' }}
run: dotnet nuget push **/*.nupkg -k ${{ secrets.MYGET_API_KEY }} -s https://www.myget.org/F/mqttnet/api/v3/index.json --skip-duplicate