-
Notifications
You must be signed in to change notification settings - Fork 2
104 lines (86 loc) · 2.33 KB
/
ci.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: ci
on:
push:
branches: [main]
tags-ignore:
- '*'
pull_request:
branches: [main]
tags-ignore:
- '*'
paths-ignore:
- '**.md'
- '.editorconfig'
- 'docs/**'
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
build:
name: ${{ matrix.platform }} build
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout Git repository
uses: actions/checkout@main
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
global-json-file: global.json
- name: Build and test
run: |
dotnet restore
dotnet build --configuration Release --no-restore
dotnet test --configuration Release --verbosity minimal --no-build
code-ql:
name: code-ql analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['csharp']
steps:
- name: Checkout Git repository
uses: actions/checkout@main
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
global-json-file: global.json
- name: Initialize CodeQL
uses: github/codeql-action/init@main
with:
languages: ${{ matrix.language }}
- name: Restore dependencies
run: dotnet restore --verbosity normal
- name: Build
run: dotnet build --no-restore /p:UseSharedCompilation=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@main
dev-skim:
name: dev skim analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout Git repository
uses: actions/checkout@main
- name: Run DevSkim scanner
uses: microsoft/DevSkim-Action@main
with:
directory-to-scan: src
extra-options: '--console-verbosity Verbose'
- name: Upload DevSkim scan results to GitHub security
uses: github/codeql-action/upload-sarif@main
with:
sarif_file: devskim-results.sarif