-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.14 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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: |
echo "" > .env
dotnet publish -c ${{ env.dotNetConfiguration }} -r linux-x64 --no-self-contained
- name: Test
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage"