diff --git a/src/Fallout.Common/CI/AppVeyor/Configuration/AppVeyorConfiguration.cs b/src/Fallout.Common/CI/AppVeyor/Configuration/AppVeyorConfiguration.cs index 4e76c58d6..99f2b9f3c 100644 --- a/src/Fallout.Common/CI/AppVeyor/Configuration/AppVeyorConfiguration.cs +++ b/src/Fallout.Common/CI/AppVeyor/Configuration/AppVeyorConfiguration.cs @@ -110,8 +110,13 @@ public override void Write(CustomFileWriter writer) using (writer.WriteBlock("build_script:")) { - writer.WriteLine($@"- cmd: .\{BuildCmdPath} {InvokedTargets.JoinSpace()}"); - writer.WriteLine($@"- sh: ./{BuildCmdPath} {InvokedTargets.JoinSpace()}"); + // Invoke the `fallout` local tool (cross-platform) rather than the OS-specific build script. + // AppVeyor runs `- cmd:` lines only on Windows images and `- sh:` lines only on the rest, so + // emit both; the command itself is identical. See GitHub Actions (dotnet fallout) and issue #516. + writer.WriteLine("- cmd: dotnet tool restore"); + writer.WriteLine($"- cmd: dotnet fallout {InvokedTargets.JoinSpace()}"); + writer.WriteLine("- sh: dotnet tool restore"); + writer.WriteLine($"- sh: dotnet fallout {InvokedTargets.JoinSpace()}"); } if (Cache.Length > 0) diff --git a/src/Fallout.Common/CI/AzurePipelines/Configuration/AzurePipelinesCmdStep.cs b/src/Fallout.Common/CI/AzurePipelines/Configuration/AzurePipelinesCmdStep.cs index 5b6783439..c66358867 100644 --- a/src/Fallout.Common/CI/AzurePipelines/Configuration/AzurePipelinesCmdStep.cs +++ b/src/Fallout.Common/CI/AzurePipelines/Configuration/AzurePipelinesCmdStep.cs @@ -25,7 +25,10 @@ public override void Write(CustomFileWriter writer) using (writer.WriteBlock("inputs:")) { - writer.WriteLine($"script: './{BuildCmdPath} {arguments}'"); + // Invoke the `fallout` local tool (cross-platform) rather than the OS-specific build script. + // CmdLine@2 runs in the agent's default shell (cmd on Windows, bash elsewhere); `&&` works in + // both. See GitHub Actions (dotnet fallout) and issue #516. + writer.WriteLine($"script: 'dotnet tool restore && dotnet fallout {arguments}'"); } if (Imports.Count > 0) diff --git a/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AppVeyorAttribute.verified.txt b/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AppVeyorAttribute.verified.txt index 832c6d53e..11c92641c 100644 --- a/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AppVeyorAttribute.verified.txt +++ b/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AppVeyorAttribute.verified.txt @@ -31,8 +31,10 @@ install: - git submodule update --init --recursive build_script: - - cmd: .\build.cmd Test - - sh: ./build.cmd Test + - cmd: dotnet tool restore + - cmd: dotnet fallout Test + - sh: dotnet tool restore + - sh: dotnet fallout Test artifacts: - path: 'src/*/obj/**' diff --git a/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AzurePipelinesAttribute.verified.txt b/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AzurePipelinesAttribute.verified.txt index 99aa5330d..822c071d8 100644 --- a/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AzurePipelinesAttribute.verified.txt +++ b/tests/Fallout.Common.Specs/CI/ConfigurationGenerationSpecs.Test_testName=null_attribute=AzurePipelinesAttribute.verified.txt @@ -66,7 +66,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Restore' inputs: - script: './build.cmd Restore --skip' + script: 'dotnet tool restore && dotnet fallout Restore --skip' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey) @@ -99,7 +99,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Compile' inputs: - script: './build.cmd Compile --skip' + script: 'dotnet tool restore && dotnet fallout Compile --skip' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey) @@ -134,7 +134,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Test' inputs: - script: './build.cmd Test --skip --partition $(System.JobPositionInPhase)/2' + script: 'dotnet tool restore && dotnet fallout Test --skip --partition $(System.JobPositionInPhase)/2' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey) @@ -167,7 +167,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Coverage' inputs: - script: './build.cmd Coverage --skip' + script: 'dotnet tool restore && dotnet fallout Coverage --skip' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey) @@ -206,7 +206,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Restore' inputs: - script: './build.cmd Restore --skip' + script: 'dotnet tool restore && dotnet fallout Restore --skip' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey) @@ -239,7 +239,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Compile' inputs: - script: './build.cmd Compile --skip' + script: 'dotnet tool restore && dotnet fallout Compile --skip' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey) @@ -274,7 +274,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Test' inputs: - script: './build.cmd Test --skip --partition $(System.JobPositionInPhase)/2' + script: 'dotnet tool restore && dotnet fallout Test --skip --partition $(System.JobPositionInPhase)/2' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey) @@ -307,7 +307,7 @@ stages: - task: CmdLine@2 displayName: 'Run: Coverage' inputs: - script: './build.cmd Coverage --skip' + script: 'dotnet tool restore && dotnet fallout Coverage --skip' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) ApiKey: $(ApiKey)