Bump xunit from 2.5.0 to 2.5.1 (#37) #93
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: | |
push: | |
branches: [ "main" ] | |
tags: [ "*" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
SONAR_KEY: dysnomia-common-blizzardwebapi | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
CSPROJ: Dysnomia.Common.BlizzardWebAPI/Dysnomia.Common.BlizzardWebAPI.csproj | |
NUGET_SERVER_ADRESS: https://api.nuget.org/v3/index.json | |
NUGET_SERVER_KEY: ${{ secrets.NUGET_ORG_KEY }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Setup sonarscanner | |
run: | | |
dotnet tool install --global dotnet-sonarscanner | |
sudo apt-get update | |
sudo mkdir -p /usr/share/man/man1 | |
sudo apt install openjdk-11-jdk jq -y | |
- name: Start sonarscanner | |
run: dotnet sonarscanner begin /k:"${{ env.SONAR_KEY }}" /d:sonar.host.url="${{ env.SONAR_HOST_URL }}" /d:sonar.login="${{ env.SONAR_TOKEN }}" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.coverage.exclusions="**Test*.cs" /d:sonar.branch.name="${{github.ref_name}}" | |
- name: Set Version in csproj | |
if: startsWith(github.event.ref, 'refs/tags/') | |
run: sed -i 's/>1.0.0</>${{github.ref_name}}</g' ${{ env.CSPROJ }} | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
env: | |
BattleNetAccountId: ${{ secrets.BATTLENETACCOUNTID }} | |
BattleNetBattleTag: ${{ secrets.BATTLENETBATTLETAG }} | |
BattleNetHeroId: ${{ secrets.BATTLENETHEROID }} | |
BattleNetProfileId: ${{ secrets.BATTLENETPROFILEID }} | |
CLIENT_ID: ${{ secrets.BLIZZARD_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.BLIZZARD_CLIENT_SECRET }} | |
REDIRECT_URI: ${{ secrets.REDIRECT_URI }} | |
run: | | |
dotnet tool install --global dotnet-coverage | |
dotnet-coverage collect 'dotnet test --no-build --verbosity normal' -f xml -o 'coverage.xml' | |
- name: End sonarscanner | |
run: dotnet sonarscanner end /d:sonar.login="${{ env.SONAR_TOKEN }}" | |
- name: Pack | |
run: dotnet pack ${{ env.CSPROJ }} -c Release -o out | |
- name: Push | |
if: startsWith(github.event.ref, 'refs/tags/') | |
run: dotnet nuget push -s ${{ env.NUGET_SERVER_ADRESS }} -k ${{ env.NUGET_SERVER_KEY }} $(ls out/*.nupkg | head -1) |