-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathsample-workflow-ubuntu-latest.yml
More file actions
48 lines (39 loc) · 1.52 KB
/
sample-workflow-ubuntu-latest.yml
File metadata and controls
48 lines (39 loc) · 1.52 KB
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
# sample-workflow-ubuntu-latest
# docs are in the repo
name: .NET Code Analysis ubuntu-latest
on:
push:
branches:
- main
jobs:
sample:
name: .NET Code Analysis runner
# .NET Code Analysis runs on windows-latest.
# ubuntu-latest and macos-latest supporting coming soon
runs-on: ubuntu-latest
steps:
# Checkout your code repository to scan
- uses: actions/checkout@v2
# Ensure compatible versions of dotnet are installed.
# The [Microsoft Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
# Remote agents already have a compatible version of dotnet installed and this step may be skipped.
# For local agents, ensure dotnet version 3.1.201 or later is installed by including this action:
# - uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'
# Run NuGet restore for the solution at repo root
- name: Run NuGet restore
run: dotnet restore
# Run code analysis for the solution at repo root
- name: Run .NET Code Analysis
uses: dotnet/code-analysis@main
id: code-analysis
with:
build-breaking: false
# Upload the analysis results file
- name: Upload analysis results
uses: actions/upload-artifact@v2
with:
name: analysis_results.sarif
path: ${{ steps.code-analysis.outputs.sarifFile }}