Skip to content

Commit 7578cc1

Browse files
committed
Don't call LoadOsm() when running on GitHub Actions.
1 parent 36ced37 commit 7578cc1

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎MapWinGisTests-net/WinFormsApp1/Form1.cs‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public Form1()
1414
CallbackVerbosity = tkCallbackVerbosity.cvAll
1515
};
1616

17-
// Test with Showing form for x86 and x64
18-
//if(Environment.Is64BitProcess)
17+
if(!IsRunningOnGitHubActions)
1918
{
20-
Shown += (s, e) => LoadOsm(); // This need to be done after the form is shown (x64)
19+
// Don't call LoadOsm() when running on GitHub Actions.
20+
Shown += (s, e) => LoadOsm(); // This need to be done after the form is shown (x64)
2121
}
2222
/*else
2323
{
@@ -27,7 +27,15 @@ public Form1()
2727
GetMapWinGisVersion();
2828
}
2929

30-
private void AxMap1_FileDropped(object sender, _DMapEvents_FileDroppedEvent e)
30+
31+
internal static bool IsRunningOnGitHubActions =>
32+
string.Equals(
33+
Environment.GetEnvironmentVariable("GITHUB_ACTIONS"),
34+
"true",
35+
StringComparison.OrdinalIgnoreCase);
36+
37+
38+
private void AxMap1_FileDropped(object sender, _DMapEvents_FileDroppedEvent e)
3139
{
3240
TxtProgress.Text += $@"Opening {e.filename} after dropping.{Environment.NewLine}";
3341
axMap1.AddLayerFromFilename(e.filename, tkFileOpenStrategy.fosAutoDetect, true);

0 commit comments

Comments
 (0)