Skip to content

Commit d469476

Browse files
committed
add way to skip tests in publish pipeline
1 parent 4e920de commit d469476

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
run: dotnet run --project build
3030
env:
3131
BuildNet7: true
32+
IgnoreTests: true
3233
- name: Get Changelog Entry
3334
id: changelog_reader
3435
uses: mindsers/[email protected]

build/Program.fs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ let DoNothing = ignore
3333
let init args =
3434
initializeContext args
3535

36-
let testNet7 =
36+
let buildNet7 =
3737
match System.Environment.GetEnvironmentVariable("BuildNet7") |> bool.TryParse with
3838
| true, v -> v
3939
| _ -> false
4040

41+
let ignoreTest =
42+
match System.Environment.GetEnvironmentVariable("IgnoreTest") |> bool.TryParse with
43+
| true, v -> v
44+
| _ -> false
45+
4146
let packages () = !! "src/**/*.nupkg"
4247

4348
Target.create "Clean" (fun _ -> packages () |> Seq.iter Shell.rm)
@@ -53,8 +58,11 @@ let init args =
5358
Target.create "Test:net6.0" (fun _ -> testTFM "net6.0")
5459
Target.create "Test:net7.0" (fun _ -> testTFM "net7.0")
5560

56-
"Build" ?=> "Test:net6.0" =?> ("Test", not testNet7) |> ignore
57-
"Build" ?=> "Test:net7.0" =?> ("Test", testNet7) |> ignore
61+
if not ignoreTest then
62+
"Build" ?=> "Test:net6.0" =?> ("Test", not buildNet7) |> ignore
63+
64+
if not ignoreTest then
65+
"Build" ?=> "Test:net7.0" =?> ("Test", buildNet7) |> ignore
5866

5967
Target.create "ListPackages" (fun _ -> packages () |> Seq.iter (fun pkg -> printfn $"Found package at: {pkg}"))
6068

@@ -108,7 +116,6 @@ let main args =
108116
| _ -> Target.runOrDefaultWithArguments "Default"
109117

110118
0
111-
with
112-
| e ->
119+
with e ->
113120
printfn "%A" e
114121
1

0 commit comments

Comments
 (0)