Skip to content

Commit

Permalink
chore: Group FAKE target output in GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Feb 9, 2024
1 parent 76ed9ae commit f01a55e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env pwsh

if ($env:GITHUB_ACTION) {
echo "::group::Build FAKE project"
}

dotnet run -v:m --project build $args
16 changes: 16 additions & 0 deletions build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ module Paths =
</> "publish"
</> "FSharp.SystemTextJson.TrimTest.dll"

module Target =

let create name action =
Target.create name
<| fun o ->
if BuildServer.isGitHubActionsBuild then
try
printfn $"::group::{name}"
action o
finally
printfn "::endgroup::"
else
action o

Target.create "Clean" (fun _ -> !! "**/bin" ++ "**/obj" |> Shell.cleanDirs)

Target.create "Build" (fun _ -> DotNet.build id Paths.sln)
Expand Down Expand Up @@ -103,4 +117,6 @@ Target.create "All" ignore
"Pack" <== [ "Build" ]
"Build" <== [ if Cli.clean then "Clean" ]


if BuildServer.isGitHubActionsBuild then printfn "::endgroup::"
Target.runOrDefaultWithArguments "All"

0 comments on commit f01a55e

Please sign in to comment.