File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -143,3 +143,26 @@ jobs:
143143 runCmd : |
144144 chmod +x ./build.sh
145145 ./build.sh RunTests
146+
147+ analyze :
148+ runs-on : ubuntu-latest
149+ steps :
150+ - uses : actions/checkout@v3
151+ - name : Setup necessary dotnet SDKs
152+ uses : actions/setup-dotnet@v3
153+ with :
154+ global-json-file : global.json
155+ dotnet-version : |
156+ 8.x
157+ - name : Analyze
158+ run : |
159+ chmod +x ./build.sh
160+ ./build.sh Analyzers
161+ # This is important, you want to continue your Action even if you found problems.
162+ # As you always want the report to upload
163+ continue-on-error : true
164+ - name : Upload SARIF file
165+ uses : github/codeql-action/upload-sarif@v2
166+ with :
167+ # You can also specify the path to a folder for `sarif_file`
168+ sarif_file : analysisreports
Original file line number Diff line number Diff line change @@ -395,3 +395,6 @@ benchmarks/BenchmarkDotNet.Artifacts/
395395
396396# Python Tests Output
397397.python-tests /
398+
399+ # FSharp Analyzers
400+ analysisreports /
Original file line number Diff line number Diff line change @@ -148,12 +148,17 @@ let formatCode _ =
148148let analyze _ =
149149 let analyzerPaths = !! " packages/analyzers/**/analyzers/dotnet/fs"
150150
151- let createArgsForProject project analyzerPaths =
151+ let createArgsForProject ( project : string ) analyzerPaths =
152+ let projectName = Path.GetFileNameWithoutExtension project
153+
152154 [
153155 yield " --project"
154156 yield project
155157 yield " --analyzers-path"
156158 yield ! analyzerPaths
159+ if isCI.Value then
160+ yield " --report"
161+ yield $" analysisreports/{projectName}-analysis.sarif"
157162 ]
158163 |> String.concat " "
159164
You can’t perform that action at this time.
0 commit comments