From f627d76aa293e4ffe5cbdaf64b4c28673961ee06 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Tue, 29 Oct 2024 13:43:45 +0100 Subject: [PATCH 1/3] (build) use dotnet_version and docker_distro --- .github/actions/docker-manifests/action.yml | 8 ++++---- .github/actions/docker-publish/action.yml | 8 ++++---- .github/actions/docker-test/action.yml | 8 ++++---- .github/workflows/_artifacts_linux.yml | 8 ++++---- .github/workflows/_docker.yml | 14 ++++++------- .github/workflows/_docker_manifests.yml | 10 +++++----- .github/workflows/_unit_tests.yml | 8 ++++---- build/.run/Artifacts DotnetTool Test.run.xml | 2 +- build/.run/Artifacts MsBuildCore Test.run.xml | 2 +- build/.run/Artifacts Native Test.run.xml | 2 +- build/.run/Artifacts Prepare.run.xml | 2 +- build/.run/Artifacts Test.run.xml | 2 +- build/.run/Clean.run.xml | 2 +- ... Chores.run.xml => Default Config.run.xml} | 8 ++++---- build/.run/Docker Build.run.xml | 2 +- build/.run/Docker Manifest.run.xml | 2 +- build/.run/Docker Publish.run.xml | 2 +- build/.run/Docker Test.run.xml | 2 +- build/.run/DockerMatrix.run.xml | 20 +++++++++++++++++++ build/.run/PublishCoverage.run.xml | 2 +- build/.run/TestMatrix.run.xml | 20 +++++++++++++++++++ build/.run/UnitTest (6.0).run.xml | 2 +- build/.run/UnitTest (8.0).run.xml | 2 +- build/artifacts/BuildLifetime.cs | 6 +++--- .../Tasks/ArtifactsMsBuildFullTest.cs | 2 +- build/build/Tasks/Test/UnitTest.cs | 12 +++++------ build/common/Utilities/Arguments.cs | 3 +-- build/common/Utilities/Constants.cs | 4 ++-- .../Utilities/TaskArgumentsAttribute.cs | 6 +++--- build/docker/BuildLifetime.cs | 6 +++--- 30 files changed, 108 insertions(+), 69 deletions(-) rename build/.run/{Default Chores.run.xml => Default Config.run.xml} (75%) create mode 100644 build/.run/DockerMatrix.run.xml create mode 100644 build/.run/TestMatrix.run.xml diff --git a/.github/actions/docker-manifests/action.yml b/.github/actions/docker-manifests/action.yml index 9c9a78ef9b..7bf0945382 100644 --- a/.github/actions/docker-manifests/action.yml +++ b/.github/actions/docker-manifests/action.yml @@ -1,10 +1,10 @@ name: 'Docker Manifests' description: 'Docker Publish Manifests' inputs: - distro: + dockerDistro: description: 'Linux Distro' required: true - targetFramework: + dotnetVersion: description: '.net version' required: true docker_registry_username: @@ -32,7 +32,7 @@ runs: - name: '[Docker Publish Manifests] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry dockerhub + run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub - name: Login to GitHub uses: docker/login-action@v3 @@ -43,4 +43,4 @@ runs: - name: '[Docker Publish Manifests] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry github + run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github diff --git a/.github/actions/docker-publish/action.yml b/.github/actions/docker-publish/action.yml index feff913274..d65fbe5aee 100644 --- a/.github/actions/docker-publish/action.yml +++ b/.github/actions/docker-publish/action.yml @@ -4,10 +4,10 @@ inputs: arch: description: 'Docker architecture' required: true - distro: + dockerDistro: description: 'Linux Distro' required: true - targetFramework: + dotnetVersion: description: '.net version' required: true docker_registry_username: @@ -35,7 +35,7 @@ runs: - name: '[Docker Publish] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry dockerhub --verbosity=diagnostic + run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub --verbosity=diagnostic - name: Login to GitHub uses: docker/login-action@v3 @@ -46,4 +46,4 @@ runs: - name: '[Docker Publish] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry github --verbosity=diagnostic + run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/actions/docker-test/action.yml b/.github/actions/docker-test/action.yml index 943bc4c75b..7e450d2d8e 100644 --- a/.github/actions/docker-test/action.yml +++ b/.github/actions/docker-test/action.yml @@ -4,10 +4,10 @@ inputs: arch: description: 'Docker architecture' default: 'amd64' - distro: + dockerDistro: description: 'Linux Distro' default: 'debian.12' - targetFramework: + dotnetVersion: description: '.net version' default: '8.0' @@ -17,8 +17,8 @@ runs: - name: '[Docker Build & Test] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry dockerhub --verbosity=diagnostic + run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub --verbosity=diagnostic - name: '[Docker Build & Test] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry github --verbosity=diagnostic + run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/workflows/_artifacts_linux.yml b/.github/workflows/_artifacts_linux.yml index 5d6bcd5454..262adf454d 100644 --- a/.github/workflows/_artifacts_linux.yml +++ b/.github/workflows/_artifacts_linux.yml @@ -14,12 +14,12 @@ env: jobs: artifacts: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false matrix: - distro: + dockerDistro: - alpine.3.20 - centos.stream.9 - debian.12 @@ -27,7 +27,7 @@ jobs: - ubuntu.20.04 - ubuntu.22.04 - ubuntu.24.04 - targetFramework: [ '8.0', '6.0' ] + dotnetVersion: [ '8.0', '6.0' ] steps: - @@ -53,4 +53,4 @@ jobs: - name: '[Test Artifacts]' shell: pwsh - run: dotnet run/artifacts.dll --target=ArtifactsTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} \ No newline at end of file + run: dotnet run/artifacts.dll --target=ArtifactsTest --arch=${{ inputs.arch }} --dotnet_version=${{ matrix.dotnetVersion }} --docker_distro=${{ matrix.dockerDistro }} \ No newline at end of file diff --git a/.github/workflows/_docker.yml b/.github/workflows/_docker.yml index c502782848..b226199e38 100644 --- a/.github/workflows/_docker.yml +++ b/.github/workflows/_docker.yml @@ -14,12 +14,12 @@ env: jobs: docker: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false matrix: - distro: + dockerDistro: - alpine.3.20 - centos.stream.9 - debian.12 @@ -27,7 +27,7 @@ jobs: - ubuntu.20.04 - ubuntu.22.04 - ubuntu.24.04 - targetFramework: [ '8.0', '6.0' ] + dotnetVersion: [ '8.0', '6.0' ] steps: - @@ -65,16 +65,16 @@ jobs: uses: ./.github/actions/docker-test with: arch: ${{ inputs.arch }} - distro: ${{ matrix.distro }} - targetFramework: ${{ matrix.targetFramework }} + dockerDistro: ${{ matrix.dockerDistro }} + dotnetVersion: ${{ matrix.dotnetVersion }} - name: Docker Publish if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' uses: ./.github/actions/docker-publish with: arch: ${{ inputs.arch }} - distro: ${{ matrix.distro }} - targetFramework: ${{ matrix.targetFramework }} + dockerDistro: ${{ matrix.dockerDistro }} + dotnetVersion: ${{ matrix.dotnetVersion }} docker_registry_username: ${{ secrets.DOCKER_USERNAME }} docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} github_registry_username: ${{ github.repository_owner }} diff --git a/.github/workflows/_docker_manifests.yml b/.github/workflows/_docker_manifests.yml index be38bf1bf5..33e65458cf 100644 --- a/.github/workflows/_docker_manifests.yml +++ b/.github/workflows/_docker_manifests.yml @@ -7,12 +7,12 @@ env: jobs: manifest: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - distro: + dockerDistro: - alpine.3.20 - centos.stream.9 - debian.12 @@ -20,7 +20,7 @@ jobs: - ubuntu.20.04 - ubuntu.22.04 - ubuntu.24.04 - targetFramework: [ '8.0', '6.0' ] + dotnetVersion: [ '8.0', '6.0' ] steps: - @@ -51,8 +51,8 @@ jobs: if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' uses: ./.github/actions/docker-manifests with: - distro: ${{ matrix.distro }} - targetFramework: ${{ matrix.targetFramework }} + dockerDistro: ${{ matrix.dockerDistro }} + dotnetVersion: ${{ matrix.dotnetVersion }} docker_registry_username: ${{ secrets.DOCKER_USERNAME }} docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} github_registry_username: ${{ github.repository_owner }} diff --git a/.github/workflows/_unit_tests.yml b/.github/workflows/_unit_tests.yml index b59c395694..96d954d9e5 100644 --- a/.github/workflows/_unit_tests.yml +++ b/.github/workflows/_unit_tests.yml @@ -7,14 +7,14 @@ env: jobs: unit_test: - name: ${{ matrix.os }} - net${{ matrix.targetFramework }} + name: ${{ matrix.os }} - net${{ matrix.dotnetVersion }} env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} strategy: fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-15] - targetFramework: [ '8.0', '6.0' ] + dotnetVersion: [ '8.0', '6.0' ] runs-on: ${{ matrix.os }} steps: @@ -29,11 +29,11 @@ jobs: - name: '[Unit Test]' shell: pwsh - run: dotnet run/build.dll --target=Test --dotnet_target=${{ matrix.targetFramework }} + run: dotnet run/build.dll --target=Test --dotnet_version=${{ matrix.dotnetVersion }} - name: Test Summary uses: test-summary/action@v2.4 - if: matrix.targetFramework == '8.0' + if: matrix.dotnetVersion == '8.0' with: paths: artifacts/test-results/*.results.xml diff --git a/build/.run/Artifacts DotnetTool Test.run.xml b/build/.run/Artifacts DotnetTool Test.run.xml index 5d80a2eedf..5a4546c2b5 100644 --- a/build/.run/Artifacts DotnetTool Test.run.xml +++ b/build/.run/Artifacts DotnetTool Test.run.xml @@ -1,7 +1,7 @@