Skip to content

Commit

Permalink
updated the list of distros, removed the end of support
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Feb 18, 2023
1 parent 926c38d commit 10150db
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 51 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Prepare]'
if: steps.cache-cake.outputs.cache-hit != 'true'
Expand All @@ -75,7 +75,7 @@ jobs:
path: ${{ github.workspace }}/dogfood

build:
name: Build code & Package
name: Build & Package
needs: [prepare]
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Build]'
shell: pwsh
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
path: ${{ github.workspace }}/artifacts/packages/native/*.tar.gz

unit_test:
name: Unit Test code
name: Test
needs: [prepare]
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Unit Test]'
shell: pwsh
Expand All @@ -196,7 +196,7 @@ jobs:
if: always()

artifacts_windows_test:
name: Test artifacts on windows
name: Artifacts
needs: [build]
runs-on: windows-latest
strategy:
Expand Down Expand Up @@ -240,20 +240,20 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Test Artifacts]'
shell: pwsh
run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test

artifacts_linux_test:
name: Test artifacts in docker
name: Artifacts
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '7.0', '6.0' ]
distro: [ alpine.3.13, alpine.3.14, centos.7, centos.8, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04, ubuntu.22.04 ]
distro: [ alpine.3.15, alpine.3.16, alpine.3.17, centos.7, centos.stream.8, fedora.36, debian.10, debian.11, ubuntu.18.04, ubuntu.20.04, ubuntu.22.04 ]
fail-fast: false

steps:
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Test Artifacts (amd64)]'
shell: pwsh
Expand All @@ -317,13 +317,13 @@ jobs:
run: dotnet run/artifacts.dll --target=ArtifactsTest --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }}

docker_linux_images:
name: Build, Test and Publish Docker Images
name: Docker Images
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '7.0', '6.0' ]
distro: [ alpine.3.13, alpine.3.14, centos.7, centos.8, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04, ubuntu.22.04 ]
distro: [ alpine.3.15, alpine.3.16, alpine.3.17, centos.7, centos.stream.8, fedora.36, debian.10, debian.11, ubuntu.18.04, ubuntu.20.04, ubuntu.22.04 ]
fail-fast: false

steps:
Expand Down Expand Up @@ -370,7 +370,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: Login to DockerHub
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
Expand Down Expand Up @@ -466,7 +466,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Publish]'
shell: pwsh
Expand Down Expand Up @@ -526,7 +526,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Release]'
shell: pwsh
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ on:

permissions:
contents: read
env:
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1

jobs:
analyze:
Expand Down Expand Up @@ -61,7 +66,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'

-
name: '[Prepare]'
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:
- .github/workflows/docs.yml
env:
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1

jobs:
prepare:
Expand Down Expand Up @@ -75,12 +78,19 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Prepare]'
if: steps.cache-cake.outputs.cache-hit != 'true'
run: dotnet build build/CI.sln --configuration=Release

run: |
dotnet build build/CI.sln --configuration=Release
dotnet run/build.dll --target=BuildPrepare
-
name: 'Upload gitversion tool'
uses: actions/upload-artifact@v3
with:
name: tool
path: ${{ github.workspace }}/dogfood
validate:
name: Validates Html
needs: [prepare]
Expand Down Expand Up @@ -109,7 +119,13 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
uses: actions/download-artifact@v3
name: Download gitversion tool
with:
name: tool
path: ${{ github.workspace }}/dogfood
-
name: '[Build Documentation]'
shell: pwsh
Expand Down Expand Up @@ -164,7 +180,7 @@ jobs:
name: Setup .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: '7.0.102'
dotnet-version: '7.0.x'
-
name: '[Publish Documentation]'
if: ${{ github.event_name == 'push' }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ on:
permissions:
contents: read

env:
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1

jobs:
format:
runs-on: windows-latest
Expand Down
4 changes: 2 additions & 2 deletions build/artifacts/Tasks/ArtifactsDotnetToolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Artifacts.Tasks;
[TaskDescription("Tests the dotnet global tool in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version70)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine313, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine315, Constants.Debian11, Constants.Ubuntu2204)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsDotnetToolTest : FrostingTask<BuildContext>
{
Expand All @@ -27,7 +27,7 @@ public override void Run(BuildContext context)

foreach (var dockerImage in context.Images)
{
if (context.SkipImage(dockerImage)) continue;
if (context.SkipImageForArtifacts(dockerImage)) continue;

var cmd = $"{rootPrefix}/scripts/test-global-tool.sh --version {version} --nugetPath {rootPrefix}/nuget --repoPath {rootPrefix}/repo";

Expand Down
4 changes: 2 additions & 2 deletions build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Artifacts.Tasks;
[TaskDescription("Tests the msbuild package in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version70)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine313, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine315, Constants.Debian11, Constants.Ubuntu2204)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsMsBuildCoreTest : FrostingTask<BuildContext>
{
Expand All @@ -27,7 +27,7 @@ public override void Run(BuildContext context)

foreach (var dockerImage in context.Images)
{
if (context.SkipImage(dockerImage)) continue;
if (context.SkipImageForArtifacts(dockerImage)) continue;

string targetFramework = dockerImage.TargetFramework;

Expand Down
4 changes: 2 additions & 2 deletions build/artifacts/Tasks/ArtifactsNativeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Artifacts.Tasks;
[TaskDescription("Tests the native executables in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version70)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine313, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine315, Constants.Debian11, Constants.Ubuntu2204)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsNativeTest : FrostingTask<BuildContext>
{
Expand All @@ -27,7 +27,7 @@ public override void Run(BuildContext context)

foreach (var dockerImage in context.Images)
{
if (context.SkipImage(dockerImage)) continue;
if (context.SkipImageForArtifacts(dockerImage)) continue;

var runtime = dockerImage.Architecture == Architecture.Amd64 ? "linux-x64" : "linux-arm64";
if (dockerImage.Distro.StartsWith("alpine"))
Expand Down
4 changes: 2 additions & 2 deletions build/artifacts/Tasks/ArtifactsPrepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Artifacts.Tasks;
[TaskDescription("Pulls the docker images needed for testing the artifacts")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version70)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine313, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine315, Constants.Debian11, Constants.Ubuntu2204)]
public class ArtifactsPrepare : FrostingTask<BuildContext>
{
public override bool ShouldRun(BuildContext context)
Expand All @@ -21,7 +21,7 @@ public override void Run(BuildContext context)
{
foreach (var dockerImage in context.Images)
{
if (context.SkipImage(dockerImage)) continue;
if (context.SkipImageForArtifacts(dockerImage)) continue;
context.DockerPullImage(dockerImage);
}
}
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Artifacts.Tasks;
[TaskDescription("Tests packages in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version70)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine313, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine315, Constants.Debian11, Constants.Ubuntu2204)]
[IsDependentOn(typeof(ArtifactsNativeTest))]
[IsDependentOn(typeof(ArtifactsDotnetToolTest))]
[IsDependentOn(typeof(ArtifactsMsBuildCoreTest))]
Expand Down
21 changes: 11 additions & 10 deletions build/common/Utilities/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ public class Constants
public const string DefaultBranch = "main";
public const string DefaultConfiguration = "Release";

public static readonly string[] VersionsToBuild = { Version60, Version70 };
public static readonly Architecture[] ArchToBuild = { Architecture.Amd64, Architecture.Arm64 };
public static readonly string[] DistrosToSkip = { Alpine313, Alpine314, Centos7, Ubuntu2204 };
public static readonly string[] VersionsToBuild = { Version60, Version70 };
public static readonly string[] DistrosToSkipForArtifacts = { Alpine315, Alpine316, Alpine317, Centos7 };
public static readonly string[] DistrosToSkipForDocker = { Centos7 };

public const string DockerBaseImageName = "gittools/build-images";
public const string DockerImageName = "gittools/gitversion";
Expand All @@ -31,28 +32,28 @@ public class Constants
public const string Arm64 = "arm64";
public const string Amd64 = "amd64";

public const string Alpine313 = "alpine.3.13";
public const string Alpine314 = "alpine.3.14";
public const string Alpine315 = "alpine.3.15";
public const string Alpine316 = "alpine.3.16";
public const string Alpine317 = "alpine.3.17";
public const string Centos7 = "centos.7";
public const string Centos8 = "centos.8";
public const string CentosStream8 = "centos.stream.8";
public const string Fedora36 = "fedora.36";
public const string Debian10 = "debian.10";
public const string Debian11 = "debian.11";
public const string Fedora33 = "fedora.33";
public const string Ubuntu1804 = "ubuntu.18.04";
public const string Ubuntu2004 = "ubuntu.20.04";
public const string Ubuntu2204 = "ubuntu.22.04";
public const string DockerDistroLatest = Debian11;
public static readonly string[] DockerDistrosToBuild =
{
Alpine313,
Alpine314,
Alpine315,
Alpine316,
Alpine317,
Centos7,
Centos8,
CentosStream8,
Fedora36,
Debian10,
Debian11,
Fedora33,
Ubuntu1804,
Ubuntu2004,
Ubuntu2204
Expand Down
17 changes: 14 additions & 3 deletions build/common/Utilities/DockerContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ public enum Architecture
}
public static class DockerContextExtensions
{
public static bool SkipImage(this ICakeContext context, DockerImage dockerImage)
public static bool SkipImageForArtifacts(this ICakeContext context, DockerImage dockerImage)
{
var (distro, targetFramework, architecture, _, _) = dockerImage;

if (architecture == Architecture.Amd64) return false;
if (!Constants.DistrosToSkip.Contains(distro)) return false;
if (!Constants.DistrosToSkipForArtifacts.Contains(distro)) return false;

context.Information($"Skipping Target: {targetFramework}, Distro: {distro}, Arch: {architecture}");
return true;
}

public static bool SkipImageForDocker(this ICakeContext context, DockerImage dockerImage)
{
var (distro, targetFramework, architecture, _, _) = dockerImage;

if (architecture == Architecture.Amd64) return false;
if (!Constants.DistrosToSkipForDocker.Contains(distro)) return false;

context.Information($"Skipping Target: {targetFramework}, Distro: {distro}, Arch: {architecture}");
return true;
Expand Down Expand Up @@ -63,7 +74,7 @@ public static void DockerPushImage(this BuildContextBase context, DockerImage do
}
}

public static void DockerCreateManifest(this BuildContextBase context, DockerImage dockerImage, bool skipArm64Image)
public static void DockerCreateManifest(this BuildContextBase context, DockerImage dockerImage, bool skipArm64Image = false)
{
var manifestTags = context.GetDockerTags(dockerImage);
foreach (var tag in manifestTags)
Expand Down
Loading

0 comments on commit 10150db

Please sign in to comment.