Skip to content

Commit 4db24ac

Browse files
author
Harry
committed
explicitly set build config in tests
1 parent d26a948 commit 4db24ac

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ env:
99

1010
jobs:
1111
build:
12-
if: startsWith(github.ref, 'refs/heads/release/')
1312
runs-on: ubuntu-latest
1413
steps:
1514
- uses: actions/checkout@v2
@@ -36,6 +35,7 @@ jobs:
3635
name: packages
3736
path: ./out
3837
- name: Create Release
38+
if: startsWith(github.ref, 'refs/heads/release/')
3939
uses: marvinpinto/action-automatic-releases@v1.1.1
4040
with:
4141
repo_token: "${{ secrets.GITHUB_TOKEN }}"
@@ -45,10 +45,14 @@ jobs:
4545
files: |
4646
./out/*
4747
- name: Push to Nuget.org
48+
if: startsWith(github.ref, 'refs/heads/release/')
4849
run: dotnet nuget push ${{ format('./out/Neo.Assertions.{0}.nupkg', steps.nbgv.outputs.NuGetPackageVersion) }} --api-key ${{ secrets.NUGET_ORG_TOKEN }} --source https://api.nuget.org/v3/index.json
4950
- name: Push to Nuget.org
51+
if: startsWith(github.ref, 'refs/heads/release/')
5052
run: dotnet nuget push ${{ format('./out/Neo.BuildTasks.{0}.nupkg', steps.nbgv.outputs.NuGetPackageVersion) }} --api-key ${{ secrets.NUGET_ORG_TOKEN }} --source https://api.nuget.org/v3/index.json
5153
- name: Push to Nuget.org
54+
if: startsWith(github.ref, 'refs/heads/release/')
5255
run: dotnet nuget push ${{ format('./out/Neo.Test.Harness.{0}.nupkg', steps.nbgv.outputs.NuGetPackageVersion) }} --api-key ${{ secrets.NUGET_ORG_TOKEN }} --source https://api.nuget.org/v3/index.json
5356
- name: Push to Nuget.org
57+
if: startsWith(github.ref, 'refs/heads/release/')
5458
run: dotnet nuget push ${{ format('./out/Neo.Test.Runner.{0}.nupkg', steps.nbgv.outputs.NuGetPackageVersion) }} --api-key ${{ secrets.NUGET_ORG_TOKEN }} --source https://api.nuget.org/v3/index.json

test/test-build-tasks/Extensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.IO;
34
using System.Linq;
45
using Microsoft.Build.Utilities.ProjectCreation;
@@ -51,9 +52,10 @@ public static void RunThrow(this IProcessRunner @this, string command, string ar
5152
}
5253
}
5354

54-
public static ProjectCreator AssertBuild(this ProjectCreator @this, ITestOutputHelper? output = null)
55+
public static ProjectCreator AssertBuild(this ProjectCreator @this, ITestOutputHelper? output = null, string configuration = "Debug")
5556
{
56-
@this.TryBuild(restore: true, out bool result, out BuildOutput buildOutput);
57+
var props = new Dictionary<string, string> { { "Configuration", configuration } };
58+
@this.TryBuild(restore: true, props, out bool result, out BuildOutput buildOutput);
5759
if (!result)
5860
{
5961
if (output != null)

0 commit comments

Comments
 (0)