attach husky to project #4
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 ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: [ '8.0.100' ] | |
env: | |
dotNetConfiguration: Release | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install Tools | |
run: dotnet tool restore | |
- name: Check formatting | |
run: dotnet format --verify-no-changes | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Check packages vulnerabilities | |
run: | | |
exec 5>&1 | |
OUT=$(dotnet list package --include-transitive --vulnerable | tee /dev/fd/5) | |
if [[ $OUT =~ "has the following vulnerable packages" ]] ; then exit 1 ; fi | |
- name: Build | |
run: dotnet publish -c ${{ env.dotNetConfiguration }} -r linux-x64 --no-self-contained | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" |