Skip to content

Commit 4ce04d7

Browse files
Try reading the env var directly.
1 parent 17890a7 commit 4ce04d7

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tests/ImageSharp.Web.Tests/TestUtilities/TestEnvironment.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Apache License, Version 2.0.
33

4+
using System;
5+
46
namespace SixLabors.ImageSharp.Web.Tests.TestUtilities
57
{
68
internal static class TestEnvironment
@@ -11,7 +13,18 @@ internal static class TestEnvironment
1113
#if ENV_CI
1214
internal static bool RunsOnCI => true;
1315
#else
14-
internal static bool RunsOnCI => false;
15-
#endif
16+
internal static bool RunsOnCI
17+
{
18+
get
19+
{
20+
// TODO: Something weird going on with our environment constants here.
21+
// try reading the environment directly.
22+
// https://docs.github.com/en/actions/learn-github-actions/environment-variables
23+
string variable = Environment.GetEnvironmentVariable("CI");
24+
bool.TryParse(variable, out bool result);
25+
return result;
26+
}
27+
}
1628
}
29+
#endif
1730
}

0 commit comments

Comments
 (0)