diff --git a/.github/actions/docker-manifests/action.yml b/.github/actions/docker-manifests/action.yml index 7bf0945382..23de24c989 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: - dockerDistro: + docker_distro: description: 'Linux Distro' required: true - dotnetVersion: + dotnet_version: description: '.net version' required: true docker_registry_username: @@ -32,7 +32,10 @@ runs: - name: '[Docker Publish Manifests] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub + run: | + dotnet run/docker.dll ` + --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub - name: Login to GitHub uses: docker/login-action@v3 @@ -43,4 +46,7 @@ runs: - name: '[Docker Publish Manifests] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github + run: | + dotnet run/docker.dll ` + --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github diff --git a/.github/actions/docker-publish/action.yml b/.github/actions/docker-publish/action.yml index d65fbe5aee..e5f2e05757 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 - dockerDistro: + docker_distro: description: 'Linux Distro' required: true - dotnetVersion: + dotnet_version: description: '.net version' required: true docker_registry_username: @@ -35,7 +35,10 @@ runs: - name: '[Docker Publish] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub --verbosity=diagnostic + run: | + dotnet run/docker.dll ` + --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub --verbosity=diagnostic - name: Login to GitHub uses: docker/login-action@v3 @@ -46,4 +49,7 @@ runs: - name: '[Docker Publish] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github --verbosity=diagnostic + run: | + dotnet run/docker.dll ` + --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/actions/docker-setup/action.yml b/.github/actions/docker-setup/action.yml new file mode 100644 index 0000000000..7b75cebdfd --- /dev/null +++ b/.github/actions/docker-setup/action.yml @@ -0,0 +1,16 @@ +name: 'Docker Setup' +description: 'Setups the docker engine' + +runs: + using: 'composite' + steps: + - name: Set up Docker + uses: docker/setup-docker-action@v4 + with: + daemon-config: '{ "features": { "containerd-snapshotter": true } }' + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: 'latest' + driver-opts: 'image=moby/buildkit:buildx-stable-1' + install: true diff --git a/.github/actions/docker-test/action.yml b/.github/actions/docker-test/action.yml index 7e450d2d8e..c7a747121f 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' - dockerDistro: + docker_distro: description: 'Linux Distro' default: 'debian.12' - dotnetVersion: + dotnet_version: description: '.net version' default: '8.0' @@ -17,8 +17,14 @@ runs: - name: '[Docker Build & Test] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub --verbosity=diagnostic + run: | + dotnet run/docker.dll --target=DockerTest ` + --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub --verbosity=diagnostic - name: '[Docker Build & Test] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github --verbosity=diagnostic + run: | + dotnet run/docker.dll --target=DockerTest ` + --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/workflows/_artifacts_linux.yml b/.github/workflows/_artifacts_linux.yml index ceb3e7c969..813732178b 100644 --- a/.github/workflows/_artifacts_linux.yml +++ b/.github/workflows/_artifacts_linux.yml @@ -7,10 +7,10 @@ on: arch: required: true type: string - dockerDistros: + docker_distros: required: true type: string - dotnetVersions: + dotnet_versions: required: true type: string env: @@ -19,13 +19,13 @@ env: jobs: artifacts: - name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false - matrix: - dockerDistro: ${{ fromJson(inputs.dockerDistros) }} - dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} + matrix: + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - name: Checkout @@ -47,7 +47,13 @@ jobs: with: name: native-Linux path: ${{ github.workspace }}/artifacts/packages/native + - + name: Set up Docker + uses: ./.github/actions/docker-setup - name: '[Test Artifacts]' shell: pwsh - run: dotnet run/artifacts.dll --target=ArtifactsTest --arch=${{ inputs.arch }} --dotnet_version=${{ matrix.dotnetVersion }} --docker_distro=${{ matrix.dockerDistro }} \ No newline at end of file + run: | + dotnet run/artifacts.dll ` + --target=ArtifactsTest --arch=${{ inputs.arch }} --dotnet_version=${{ matrix.dotnet_version }} ` + --docker_distro=${{ matrix.docker_distro }} \ No newline at end of file diff --git a/.github/workflows/_docker.yml b/.github/workflows/_docker.yml index 8514377ad6..5ca990810d 100644 --- a/.github/workflows/_docker.yml +++ b/.github/workflows/_docker.yml @@ -7,10 +7,10 @@ on: arch: required: true type: string - dockerDistros: + docker_distros: required: true type: string - dotnetVersions: + dotnet_versions: required: true type: string env: @@ -19,13 +19,13 @@ env: jobs: docker: - name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false matrix: - dockerDistro: ${{ fromJson(inputs.dockerDistros) }} - dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - name: Checkout @@ -43,35 +43,23 @@ jobs: path: ${{ github.workspace }}/artifacts/packages/nuget - name: Set up Docker - uses: docker/setup-docker-action@v4 - with: - daemon-config: '{ "features": { "containerd-snapshotter": true } }' - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: 'latest' - driver-opts: 'image=moby/buildkit:buildx-stable-1' - install: true + uses: ./.github/actions/docker-setup - name: Docker Test if: success() && github.event_name == 'pull_request' || github.repository_owner != 'GitTools' uses: ./.github/actions/docker-test with: arch: ${{ inputs.arch }} - dockerDistro: ${{ matrix.dockerDistro }} - dotnetVersion: ${{ matrix.dotnetVersion }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} - 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 }} - dockerDistro: ${{ matrix.dockerDistro }} - dotnetVersion: ${{ matrix.dotnetVersion }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} 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 9a1fdeb2b1..1212d8b4a7 100644 --- a/.github/workflows/_docker_manifests.yml +++ b/.github/workflows/_docker_manifests.yml @@ -1,10 +1,10 @@ on: workflow_call: inputs: - dockerDistros: + docker_distros: required: true type: string - dotnetVersions: + dotnet_versions: required: true type: string env: @@ -13,13 +13,13 @@ env: jobs: manifest: - name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - dockerDistro: ${{ fromJson(inputs.dockerDistros) }} - dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - name: Checkout @@ -31,26 +31,14 @@ jobs: uses: ./.github/actions/cache-restore - name: Set up Docker - uses: docker/setup-docker-action@v4 - with: - daemon-config: '{ "features": { "containerd-snapshotter": true } }' - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: 'latest' - driver-opts: 'image=moby/buildkit:buildx-stable-1' - install: true + uses: ./.github/actions/docker-setup - name: Docker Manifests if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' uses: ./.github/actions/docker-manifests with: - dockerDistro: ${{ matrix.dockerDistro }} - dotnetVersion: ${{ matrix.dotnetVersion }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} docker_registry_username: ${{ secrets.DOCKER_USERNAME }} docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} github_registry_username: ${{ github.repository_owner }} diff --git a/.github/workflows/_prepare.yml b/.github/workflows/_prepare.yml index 1ab92c7163..58c8e6b9b1 100644 --- a/.github/workflows/_prepare.yml +++ b/.github/workflows/_prepare.yml @@ -1,12 +1,12 @@ on: workflow_call: outputs: - dockerDistros: + docker_distros: description: 'List of Docker distros' - value: ${{ jobs.set_matrix.outputs.dockerDistros }} - dotnetVersions: + value: ${{ jobs.set_matrix.outputs.docker_distros }} + dotnet_versions: description: 'List of .NET versions' - value: ${{ jobs.set_matrix.outputs.dotnetVersions }} + value: ${{ jobs.set_matrix.outputs.dotnet_versions }} jobs: prepare: name: ${{ matrix.os }} @@ -51,8 +51,8 @@ jobs: name: Set Matrix runs-on: ubuntu-24.04 outputs: - dockerDistros: ${{ steps.set_matrix.outputs.dockerDistros }} - dotnetVersions: ${{ steps.set_matrix.outputs.dotnetVersions }} + docker_distros: ${{ steps.set_matrix.outputs.docker_distros }} + dotnet_versions: ${{ steps.set_matrix.outputs.dotnet_versions }} steps: - name: Checkout diff --git a/.github/workflows/_unit_tests.yml b/.github/workflows/_unit_tests.yml index f06c55a71d..7557db2398 100644 --- a/.github/workflows/_unit_tests.yml +++ b/.github/workflows/_unit_tests.yml @@ -1,7 +1,7 @@ on: workflow_call: inputs: - dotnetVersions: + dotnet_versions: required: true type: string env: @@ -10,14 +10,14 @@ env: jobs: unit_test: - name: ${{ matrix.os }} - net${{ matrix.dotnetVersion }} + name: ${{ matrix.os }} - net${{ matrix.dotnet_version }} env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} strategy: fail-fast: false matrix: os: [windows-2025, ubuntu-24.04, macos-15] - dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} runs-on: ${{ matrix.os }} steps: @@ -32,11 +32,11 @@ jobs: - name: '[Unit Test]' shell: pwsh - run: dotnet run/build.dll --target=Test --dotnet_version=${{ matrix.dotnetVersion }} + run: dotnet run/build.dll --target=Test --dotnet_version=${{ matrix.dotnet_version }} - name: Test Summary uses: test-summary/action@v2.4 - if: matrix.dotnetVersion == '9.0' + if: matrix.dotnet_version == '9.0' with: paths: artifacts/test-results/*.results.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 805050efda..4e26468265 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: needs: [ prepare ] uses: ./.github/workflows/_unit_tests.yml with: - dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} secrets: inherit artifacts_windows_test: @@ -72,13 +72,13 @@ jobs: - arch: amd64 runner: ubuntu-24.04 - arch: arm64 - runner: ubuntu-24.04 + runner: ubuntu-24.04-arm uses: ./.github/workflows/_artifacts_linux.yml with: runner: ${{ matrix.runner }} arch: ${{ matrix.arch }} - dockerDistros: ${{ needs.prepare.outputs.dockerDistros }} - dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} docker_linux_images: needs: [ prepare, build ] @@ -90,14 +90,14 @@ jobs: - arch: amd64 runner: ubuntu-24.04 - arch: arm64 - runner: ubuntu-24.04 + runner: ubuntu-24.04-arm uses: ./.github/workflows/_docker.yml with: runner: ${{ matrix.runner }} arch: ${{ matrix.arch }} - dockerDistros: ${{ needs.prepare.outputs.dockerDistros }} - dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} secrets: inherit docker_linux_manifests: @@ -105,8 +105,8 @@ jobs: name: Docker Manifests uses: ./.github/workflows/_docker_manifests.yml with: - dockerDistros: ${{ needs.prepare.outputs.dockerDistros }} - dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} secrets: inherit publish: diff --git a/build/config/Tasks/SetMatrix.cs b/build/config/Tasks/SetMatrix.cs index 44bd8a6c3d..666757cfa5 100644 --- a/build/config/Tasks/SetMatrix.cs +++ b/build/config/Tasks/SetMatrix.cs @@ -8,8 +8,8 @@ public override void Run(BuildContext context) { if (context.BuildSystem().IsRunningOnGitHubActions) { - context.GitHubActions().Commands.SetOutputParameter("dockerDistros", context.SerializeJson(Constants.DockerDistros)); - context.GitHubActions().Commands.SetOutputParameter("dotnetVersions", context.SerializeJson(Constants.DotnetVersions)); + context.GitHubActions().Commands.SetOutputParameter("docker_distros", context.SerializeJson(Constants.DockerDistros)); + context.GitHubActions().Commands.SetOutputParameter("dotnet_versions", context.SerializeJson(Constants.DotnetVersions)); } else {