Skip to content

Commit

Permalink
(ci) removed test_arm64_artifacts input for _artifacts_linux
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Dec 1, 2023
1 parent f5f5c02 commit 0a44b8d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 27 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,10 @@ dotnet_diagnostic.CA1816.severity = warning
# IDE0005: Using directive is unnecessary.
dotnet_diagnostic.IDE0005.severity = warning

# RCS1037: Remove trailing white-space.
dotnet_diagnostic.RCS1037.severity = error

# RCS1036: Remove redundant empty line.
dotnet_diagnostic.RCS1036.severity = error

[resharper_]xml_space_before_self_closing = true
13 changes: 1 addition & 12 deletions .github/workflows/_artifacts_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
arch:
required: true
type: string
test_arm64_artifacts:
required: false
type: boolean
default: false

env:
DOTNET_INSTALL_DIR: "./.dotnet"
Expand Down Expand Up @@ -47,14 +43,7 @@ jobs:
with:
name: native-${{ runner.os }}
path: ${{ github.workspace }}/artifacts/packages/native
-
name: Echo
shell: pwsh
run: |
Write-Host "Test ARM64 Artifacts: ${{ inputs.test_arm64_artifacts }}"
-
name: '[Test Artifacts]'
shell: pwsh
run: dotnet run/artifacts.dll --target=ArtifactsTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }}
env:
TEST_ARM64_ARTIFACTS: ${{ inputs.test_arm64_artifacts }}
run: dotnet run/artifacts.dll --target=ArtifactsTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }}
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
with:
runner: ubuntu-latest
arch: ${{ matrix.arch }}
test_arm64_artifacts: false

docker_linux_images:
needs: [ build ]
Expand Down
4 changes: 0 additions & 4 deletions build/artifacts/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ public class BuildContext : BuildContextBase

public bool IsDockerOnLinux { get; set; }

public bool TestArm64Artifacts { get; set; }

public Architecture? Architecture { get; set; }

public IEnumerable<DockerImage> Images { get; set; } = new List<DockerImage>();

public BuildContext(ICakeContext context) : base(context)
Expand Down
7 changes: 3 additions & 4 deletions build/artifacts/BuildLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@ public override void Setup(BuildContext context, ISetupContext info)
base.Setup(context, info);

context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", string.Empty) == "linux";
context.TestArm64Artifacts = context.EnvironmentVariable("TEST_ARM64_ARTIFACTS", false);

context.Architecture = context.HasArgument(Arguments.Architecture) ? context.Argument<Architecture>(Arguments.Architecture) : null;
var dockerRegistry = context.Argument(Arguments.DockerRegistry, DockerRegistry.DockerHub);
var dotnetVersion = context.Argument(Arguments.DockerDotnetVersion, string.Empty).ToLower();
var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower();

var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : new[] { dotnetVersion };
var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : new[] { dockerDistro };

var archs = context.Architecture.HasValue ? new[] { context.Architecture.Value } : Constants.ArchToBuild;
var architectures = context.HasArgument(Arguments.Architecture) ? context.Arguments<Architecture>(Arguments.Architecture) : Constants.ArchToBuild;


var registry = dockerRegistry == DockerRegistry.DockerHub ? Constants.DockerHubRegistry : Constants.GitHubContainerRegistry;
context.Images = from version in versions
from distro in distros
from arch in archs
from arch in architectures
select new DockerImage(distro, version, arch, registry, true);

context.StartGroup("Build Setup");
Expand Down
6 changes: 0 additions & 6 deletions build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ public override bool ShouldRun(BuildContext context)
{
var shouldRun = true;
shouldRun &= context.ShouldRun(context.IsDockerOnLinux, $"{nameof(ArtifactsMsBuildCoreTest)} works only on Docker on Linux agents.");

if (context.Architecture is Architecture.Arm64)
{
shouldRun &= context.ShouldRun(context.TestArm64Artifacts, $"{nameof(ArtifactsMsBuildCoreTest)} works only when TEST_ARM64_ARTIFACTS is enabled.");
}

return shouldRun;
}

Expand Down

0 comments on commit 0a44b8d

Please sign in to comment.