Skip to content

Commit 2c46c20

Browse files
committed
Add verify pipeline.
1 parent 2fc2a82 commit 2c46c20

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ Once built, you can run the command-line tool to self-build the docs for this di
1818
src\fsdocs-tool\bin\Debug\net6.0\fsdocs.exe watch
1919
src\fsdocs-tool\bin\Debug\net6.0\fsdocs.exe build --clean
2020

21+
### Pipelines
22+
23+
Run
24+
dotnet fsi build.fsx -- --help
25+
26+
to see what other pipelines can be run from `build.fsx`.
27+
28+
dotnet fsi build.fsx -- -p Verify
29+
30+
Will perform the linting, unit tests and analyzer check.
31+
This is useful to run locally before submitting your PR.
2132

2233
## Maintainer(s)
2334

build.fsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#r "nuget: Fun.Build, 0.3.8"
1+
#r "nuget: Fun.Build, 1.0.4"
22
#r "nuget: Fake.IO.FileSystem, 6.0.0"
33
#r "nuget: Ionide.KeepAChangelog, 0.1.8"
44

@@ -38,12 +38,21 @@ let releaseNugetVersion, _, _ =
3838

3939
let solutionFile = "FSharp.Formatting.sln"
4040

41-
pipeline "CI" {
41+
let lintStage =
4242
stage "Lint" {
4343
run "dotnet tool restore"
4444
run $"dotnet fantomas {__SOURCE_FILE__} src tests docs --check"
4545
}
4646

47+
let testStage =
48+
stage "Tests" {
49+
run
50+
$"dotnet test {solutionFile} --configuration {configuration} --no-build --blame --logger trx --framework net7.0 --results-directory TestResults"
51+
}
52+
53+
pipeline "CI" {
54+
lintStage
55+
4756
stage "Clean" {
4857
run (fun _ ->
4958
!!artifactsDir ++ "temp" |> Shell.cleanDirs
@@ -58,10 +67,7 @@ pipeline "CI" {
5867

5968
stage "NuGet" { run $"dotnet pack {solutionFile} --output \"{artifactsDir}\" --configuration {configuration}" }
6069

61-
stage "Tests" {
62-
run
63-
$"dotnet test {solutionFile} --configuration {configuration} --no-build --blame --logger trx --framework net7.0 --results-directory TestResults"
64-
}
70+
testStage
6571

6672
stage "GenerateDocs" {
6773
run (fun _ ->
@@ -80,4 +86,11 @@ pipeline "CI" {
8086
runIfOnlySpecified false
8187
}
8288

89+
pipeline "Verify" {
90+
lintStage
91+
testStage
92+
stage "Analyzers" { run "dotnet msbuild /t:AnalyzeSolution" }
93+
runIfOnlySpecified true
94+
}
95+
8396
tryPrintPipelineCommandHelp ()

0 commit comments

Comments
 (0)