Skip to content
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

test build platform #7135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
44 changes: 11 additions & 33 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,19 @@ name: PR Build
permissions:
contents: read
jobs:
build-amd64:
test-amd64:
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dapper
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: test build image
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
- name: Build
run: dapper -f Dockerfile --target dapper make dapper-ci
- name: Test
run: dapper -f Dockerfile --target dapper make test
- name: Prepare Test Logs on Failure
if: ${{ failure() }}
run: |
sudo cp -r /tmp/rke2-logs ~/rke2-logs
sudo chown -R $USER:$USER ~/rke2-logs
ls -la ~/rke2-logs
- name: Upload Logs on Failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: rke2-test-logs
path: ~/rke2-logs/
build-arm64:
runs-on: runs-on,runner=8cpu-linux-arm64,run-id=${{ github.run_id }},image=ubuntu22-full-arm64,hdd=64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dapper
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
- name: Build
run: |
dapper -f Dockerfile --target dapper make dapper-ci

export GOARCH=amd64
export GOOS=linux
export IID_FILE=$(mktemp)
export IID_FILE_FLAG="--iidfile ${IID_FILE}"
make test-publish-image-runtime-windows
4 changes: 2 additions & 2 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.20 AS build
FROM --platform=$BUILDPLATFORM alpine:3.20 AS build

RUN apk --no-cache add \
curl \
Expand Down Expand Up @@ -38,7 +38,7 @@ RUN curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/ins
WORKDIR /source
# End Dapper stuff

FROM rancher/hardened-containerd:v1.7.22-k3s1-build20241010-amd64-windows AS containerd
FROM --platform=$BUILDPLATFORM rancher/hardened-containerd:v1.7.22-k3s1-build20241010-amd64-windows AS containerd
FROM build as windows-runtime-collect
ARG KUBERNETES_VERSION=dev

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ build-image-runtime: ## Build the runtime image
publish-image-runtime:
./scripts/publish-image-runtime

.PHONY: publish-image-runtime-windows
publish-image-runtime-windows:
.PHONY: test-publish-image-runtime-windows
test-publish-image-runtime-windows:
./scripts/publish-image-runtime-windows

.PHONY: validate
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-image-runtime-windows
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ docker buildx build ${IID_FILE_FLAG} \
--tag ${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64 \
--target windows-runtime \
--file Dockerfile.windows \
--push \
--platform windows/amd64 \
.
Loading