fix packages vulnerabilities #379
Workflow file for this run
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 }}/app" | |
PROJECT_TEST: "${{ github.workspace }}/app/Spinner.Test" | |
PROJECT_SLN: "./app/Spinner.sln" | |
PROJECT_BIN3_1: "./app/Spinner/bin/Release/netcoreapp3.1" | |
PROJECT_BIN5: "./app/Spinner/bin/Release/net5.0" | |
PROJECT_BIN6: "./app/Spinner/bin/Release/net6.0" | |
PROJECT_BIN7: "./app/Spinner/bin/Release/net7.0" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: ["7.0.305"] | |
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 | |
- 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 3.1 🔍 | |
uses: microsoft/infersharpaction@v1.2 | |
with: | |
binary-path: ${{ env.PROJECT_BIN3_1 }} | |
- name: Run Infer .Net 5.0 🔍 | |
uses: microsoft/infersharpaction@v1.2 | |
with: | |
binary-path: ${{ env.PROJECT_BIN5 }} | |
- name: Run Infer .Net 6.0 🔍 | |
uses: microsoft/infersharpaction@v1.2 | |
with: | |
binary-path: ${{ env.PROJECT_BIN6 }} | |
- name: Run Infer .Net 7.0 🔍 | |
uses: microsoft/infersharpaction@v1.2 | |
with: | |
binary-path: ${{ env.PROJECT_BIN7 }} | |
- 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}} |