Skip to content

Commit

Permalink
add analyzers CI workflow and define the report name at Directory.Bui…
Browse files Browse the repository at this point in the history
…ld.Targets
  • Loading branch information
64J0 committed Jul 25, 2024
1 parent a1b2052 commit 64731df
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,30 @@ jobs:
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release
run: dotnet test -c Release

analyzers:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Restore tools
run: dotnet tool restore
- name: Build solution
run: dotnet build -c Release Giraffe.sln

- name: Run Analyzers
run: dotnet msbuild /t:AnalyzeFSharpProject src/Giraffe/Giraffe.fsproj
# This is important, you want to continue your Action even if you found problems.
# As you always want the report to upload
continue-on-error: true
# checkout code, build, run analyzers, ...
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
# You can also specify the path to a folder for `sarif_file`
sarif_file: ./src/Giraffe/analysis.sarif
1 change: 1 addition & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --analyzers-path &quot;$(PkgIonide_Analyzers)&quot;</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --configuration $(Configuration)</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --exclude-analyzers PartialAppAnalyzer</FSharpAnalyzersOtherFlags>
<FSharpAnalyzersOtherFlags>$(FSharpAnalyzersOtherFlags) --report &quot;analysis.sarif&quot;</FSharpAnalyzersOtherFlags>
</PropertyGroup>
</Project>

0 comments on commit 64731df

Please sign in to comment.