Run tests (#5) #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
SOLUTION_FOLDER: ./ | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore Ibis.MutexLeaderElection/Ibis.MutexLeaderElection.csproj | |
- name: Build | |
run: dotnet build --configuration Release | |
- name: Install Azurite | |
run: npx --yes --loglevel info azurite --version | |
- name: Start Azurite | |
shell: bash | |
run: npx --yes azurite --silent --inMemoryPersistence & | |
- name: Run tests | |
run: dotnet test Ibis.MutexLeaderElection.Tests/Ibis.MutexLeaderElection.Tests.csproj --logger 'trx;LogFileName=test-results.trx' --configuration Release --no-build --verbosity normal | |
working-directory: ${{ env.SOLUTION_FOLDER }} | |
- name: Upload test report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-report | |
path: ${{ env.SOLUTION_FOLDER }}/**/TestResults/** | |
- name: Pack with dotnet | |
run: dotnet pack Ibis.MutexLeaderElection/Ibis.MutexLeaderElection.csproj --output nuget --configuration Release | |
- name: Upload Assembly Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: Build output | |
path: /home/runner/work/Ibis.MutexLeaderElection/Ibis.MutexLeaderElection/Ibis.MutexLeaderElection/bin/Release/ | |
- name: Upload Package Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: Package output | |
path: nuget/*.nupkg | |
- name: Publish NuGet using Dotnet | |
run: dotnet nuget push nuget/*.nupkg --api-key ${{secrets.NUGET}} --skip-duplicate --source https://api.nuget.org/v3/index.json |