From 60f3dcbec88fbecc5c5e55446e0c98f4de1bc4c5 Mon Sep 17 00:00:00 2001 From: zhangzujian Date: Fri, 17 Jan 2025 09:32:27 +0000 Subject: [PATCH] ci: build arm64 base images on arm64 hosted runners (#4936) Signed-off-by: zhangzujian --- .github/workflows/build-kube-ovn-base.yaml | 54 ++++++---------------- 1 file changed, 14 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-kube-ovn-base.yaml b/.github/workflows/build-kube-ovn-base.yaml index 4b4137f26ee..6c2027b5737 100644 --- a/.github/workflows/build-kube-ovn-base.yaml +++ b/.github/workflows/build-kube-ovn-base.yaml @@ -2,43 +2,18 @@ name: Build Base on: workflow_dispatch jobs: - build-amd64: - name: Build AMD64 - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v3 - - - uses: actions/setup-go@v5 - id: setup-go - with: - go-version-file: go.mod - check-latest: true - cache: false - - - name: Build - env: - GO_VERSION: ${{ steps.setup-go.outputs.go-version }} - TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 - run: | - make base-amd64 - make base-tar-amd64 - - - name: Upload image to artifact - uses: actions/upload-artifact@v4 - with: - name: image-amd64 - path: image-amd64.tar - - build-arm64: - name: Build ARM64 - runs-on: ubuntu-22.04 + build: + strategy: + fail-fast: false + matrix: + arch: + - amd64 + - arm64 + name: Build + runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - uses: actions/setup-go@v5 id: setup-go @@ -52,19 +27,18 @@ jobs: GO_VERSION: ${{ steps.setup-go.outputs.go-version }} TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 run: | - make base-arm64 || make base-arm64 - make base-tar-arm64 + make base-${{ matrix.arch }} + make base-tar-${{ matrix.arch }} - name: Upload image to artifact uses: actions/upload-artifact@v4 with: - name: image-arm64 - path: image-arm64.tar + name: image-${{ matrix.arch }} + path: image-${{ matrix.arch }}.tar push: needs: - - build-arm64 - - build-amd64 + - build name: push runs-on: ubuntu-22.04 steps: