Skip to content

Commit

Permalink
build: fix arm build
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <[email protected]>
  • Loading branch information
ckotzbauer committed Dec 11, 2021
1 parent cc13944 commit 136a741
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
48 changes: 41 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Checkout
uses: actions/checkout@v2

- name: Install Kubebuilder
uses: RyanSiu1995/[email protected]
with:
version: 3.1.0

- name: Execute Tests
run: make test


e2e-test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -36,31 +40,61 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Checkout
uses: actions/checkout@v2

- uses: azure/setup-kubectl@v1
with:
version: 'v${{ matrix.kubernetes-version }}'

- name: Execute Tests
run: make e2e-test -e K8S_VERSION=${{ matrix.kubernetes-version }}


build-image:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Checkout
uses: actions/checkout@v2
- name: Build docker-image
uses: elgohr/Publish-Docker-Github-Action@master

- name: Build image
uses: docker/build-push-action@v2
with:
name: ckotzbauer/access-manager
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tags: "latest"
no_push: true
context: .
push: false
load: true
platforms: linux/amd64
tags: |
ckotzbauer/access-manager:latest
- name: Container scan
uses: azure/container-scan@v0
with:
Expand Down
2 changes: 1 addition & 1 deletion e2e/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ${KIND} create cluster --image kindest/node:v${K8S_VERSION}
${KIND} get kubeconfig >e2e/kind-kubeconfig
export KUBECONFIG=e2e/kind-kubeconfig

docker build -t ckotzbauer/access-manager:latest .
docker buildx build --platform=linux/amd64 -t ckotzbauer/access-manager:latest .
${KIND} load docker-image ckotzbauer/access-manager:latest

make install deploy
Expand Down

0 comments on commit 136a741

Please sign in to comment.