Skip to content

Commit 3b20c09

Browse files
committed
trying to bring back --no-restore. Fixing test path
1 parent a72a612 commit 3b20c09

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ jobs:
2222
dotnet-version: |
2323
6.0.405
2424
8.0.101
25+
- name: Install solution dependencies
26+
run: dotnet restore
2527
- name: Build
26-
run: dotnet build --configuration Release
28+
run: dotnet build --configuration Release --no-restore
2729
- name: Test Examples
2830
run: dotnet test ../examples/
2931
- name: Test & Code Coverage
30-
run: dotnet test --collect:"XPlat Code Coverage" -r codecov --verbosity normal
32+
run: dotnet test --collect:"XPlat Code Coverage" -r codecov --no-restore --verbosity normal
3133
- name: Codecov
3234
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # 3.1.0
3335
with:

libraries/tests/AWS.Lambda.Powertools.Common.Tests/Core/PowertoolsEnvironmentTest.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55
using System.Xml.Linq;
66
using System.Xml.XPath;
77
using Xunit;
8+
using Xunit.Abstractions;
89

910
namespace AWS.Lambda.Powertools.Common.Tests;
1011

1112
public class PowertoolsEnvironmentTest : IDisposable
1213
{
14+
private readonly ITestOutputHelper _testOutputHelper;
15+
16+
public PowertoolsEnvironmentTest(ITestOutputHelper testOutputHelper)
17+
{
18+
_testOutputHelper = testOutputHelper;
19+
}
20+
1321
[Fact]
1422
public void Set_Execution_Environment()
1523
{
@@ -69,7 +77,14 @@ public void Should_Use_Aspect_Injector_281()
6977
{
7078
// This test must be present until Issue: https://github.com/pamidur/aspect-injector/issues/220 is fixed
7179

72-
var directory = Path.GetFullPath("../../../../../src/Directory.Packages.props");
80+
var path = "../../../../../src/Directory.Packages.props";
81+
// Test to see if running in CI/CD and add an extra ../
82+
if (Environment.CurrentDirectory.EndsWith("codecov"))
83+
{
84+
path = "../../../../../../src/Directory.Packages.props";
85+
}
86+
87+
var directory = Path.GetFullPath(path);
7388
var doc = XDocument.Load(directory);
7489

7590
var packageReference = doc.XPathSelectElements("//PackageVersion")

0 commit comments

Comments
 (0)