Skip to content

update the workflows to test the artifacts and docker images on arm64 runners #3854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/actions/docker-manifests/action.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
14 changes: 10 additions & 4 deletions .github/actions/docker-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
16 changes: 16 additions & 0 deletions .github/actions/docker-setup/action.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 10 additions & 4 deletions .github/actions/docker-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
20 changes: 13 additions & 7 deletions .github/workflows/_artifacts_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
run: |
dotnet run/artifacts.dll `
--target=ArtifactsTest --arch=${{ inputs.arch }} --dotnet_version=${{ matrix.dotnet_version }} `
--docker_distro=${{ matrix.docker_distro }}
32 changes: 10 additions & 22 deletions .github/workflows/_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
28 changes: 8 additions & 20 deletions .github/workflows/_docker_manifests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
on:
workflow_call:
inputs:
dockerDistros:
docker_distros:
required: true
type: string
dotnetVersions:
dotnet_versions:
required: true
type: string
env:
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/_prepare.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
workflow_call:
inputs:
dotnetVersions:
dotnet_versions:
required: true
type: string
env:
Expand All @@ -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:
Expand All @@ -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
Loading