Skip to content

Commit

Permalink
Build: add action to test the build
Browse files Browse the repository at this point in the history
  • Loading branch information
aaubry committed Mar 28, 2021
1 parent c7eab1a commit 188d9dc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test build
on:
workflow_dispatch:
inputs:
ref:
description: Commit name (defaults to master)
required: false
target:
description: Command line
required: true
default: ResolveVersion --verbose

jobs:
release:
name: Test build
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.inputs.ref }}

- name: Install GitVersion.Tool
run: dotnet tool install --global GitVersion.Tool

- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./build.sh ${{ github.event.inputs.target }}
3 changes: 2 additions & 1 deletion tools/build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static int Main(string[] args)

var (options, targets) = Options.Parse(filteredArguments);
verbose = options.Verbose;
host = options.Host;
host = options.Host.DetectIfUnknown().Item1;

var operatingSystem =
RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
Expand Down Expand Up @@ -229,6 +229,7 @@ public static void WriteImportant(string text)
switch (host)
{
case Host.GitHubActions:
Console.WriteLine($"Writing a warning");
Console.WriteLine($"::warning ::{text.Replace("\\n", "%0A")}");
break;
}
Expand Down

0 comments on commit 188d9dc

Please sign in to comment.