Fixing some things (#37) #391
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: ci | |
on: | |
push: | |
tags: | |
- v* | |
branches: [main] | |
pull_request: | |
branches: [main, feature/*] | |
jobs: | |
build: | |
env: | |
APP: "${{ github.workspace }}/src" | |
PROJECT_TEST: "${{ github.workspace }}/src/Spinner.Test" | |
PROJECT_SLN: "./src/Spinner.sln" | |
PROJECT_BIN6: "./src/Spinner/bin/Release/net6.0" | |
PROJECT_BIN8: "./src/Spinner/bin/Release/net8.0" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: ["8.0.204"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get Build Version 🏷️ | |
run: | | |
Import-Module .\nupkgs\GetBuildVersion.psm1 | |
Write-Host $Env:GITHUB_REF | |
$version = GetBuildVersion -VersionString $Env:GITHUB_REF | |
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |
shell: pwsh | |
- name: Setup NuGet 🔧 | |
uses: NuGet/setup-nuget@v1.0.5 | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} 🔧 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Setup Stryker 🔧 | |
run: dotnet tool install -g dotnet-stryker --version 3.13.2 | |
- name: Install dotnet-format tool 🔧 | |
run: dotnet tool install -g dotnet-format | |
- name: Clean Dependencies 📦 | |
run: dotnet clean ${{env.PROJECT_SLN }} | |
- name: Restore Dependencies 📦 | |
run: dotnet restore ${{env.PROJECT_SLN }} | |
- name: Build ⚙️ | |
run: dotnet build ${{env.PROJECT_SLN }} -c Release -p:Version=$BUILD_VERSION --no-restore | |
- name: Format ♻️ | |
run: dotnet format ${{env.APP }} -v diag --severity error --no-restore | |
- name: Test 🧪 | |
run: dotnet test ${{env.PROJECT_SLN }} --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | |
- name: Mutant Test 🧪👾 | |
if: github.event_name == 'pull_request' | |
run: | | |
cd ${{ env.PROJECT_TEST}} | |
dotnet stryker --reporter "progress" | |
- name: Run Infer .Net 6.0 🔍 | |
uses: microsoft/infersharpaction@v1.2 | |
with: | |
binary-path: ${{ env.PROJECT_BIN6 }} | |
- name: Run Infer .Net 8.0 🔍 | |
uses: microsoft/infersharpaction@v1.2 | |
with: | |
binary-path: ${{ env.PROJECT_BIN8 }} | |
- name: Codecov 📊 | |
uses: codecov/codecov-action@v2.1.0 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
directory: ${{ env.PROJECT_TEST }} | |
file: coverage.opencover.xml | |
- name: Publish Package ✉️ | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_TOKEN}} |