-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.fsx
51 lines (43 loc) · 1.48 KB
/
build.fsx
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
#r "nuget: Fun.Build, 0.5.2"
open Fun.Build
open System.IO
let purgeBinLogCache () =
let binLogCache =
Path.Combine(Path.GetTempPath(), "FSharp.Analyzers.SDK.BinLogCache")
if (Directory.Exists(binLogCache)) then
Directory.Delete(binLogCache, true)
let restoreStage =
stage "restore" {
run "dotnet tool restore"
run "dotnet restore --locked-mode"
}
let buildStage =
stage "build" { run "dotnet build -c Release --no-restore -maxCpuCount" }
pipeline "Build" {
restoreStage
// TODO: can uncomment this after .NET SDK 9.0.101 releases
// stage "lint" { run "dotnet fantomas . --check" }
stage "build" { run "dotnet build -c Release --no-restore -maxCpuCount" }
stage "test" {
purgeBinLogCache ()
run "dotnet test -c Release --no-build"
}
stage "sample" {
run
"dotnet run --project src/FSharp.Analyzers.Cli/FSharp.Analyzers.Cli.fsproj -- --project ./samples/OptionAnalyzer/OptionAnalyzer.fsproj --analyzers-path ./artifacts/bin/OptionAnalyzer/release --verbosity d"
}
stage "docs" { run "dotnet fsdocs build --properties Configuration=Release --eval --clean --strict" }
runIfOnlySpecified false
}
pipeline "ReleaseBuild" {
restoreStage
buildStage
runIfOnlySpecified true
}
pipeline "Docs" {
restoreStage
buildStage
stage "fsdocs" { run "dotnet fsdocs watch --properties Configuration=Release --eval" }
runIfOnlySpecified true
}
tryPrintPipelineCommandHelp ()