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

✨ Cache testing image and simplify scripts #1776

Merged
merged 1 commit into from
Aug 29, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/reusable-qemu-acceptance-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ jobs:
repository: quay.io/kairos/packages
packages: utils/earthly
- run: |
earthly +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml
earthly +run-qemu-datasource-tests --PREBUILT_ISO=$(ls kairos-core-*${{ inputs.flavor }}*.iso) --FLAVOR=${{ inputs.flavor }} --SSH_PORT=${{ inputs.port }}
1 change: 0 additions & 1 deletion .github/workflows/reusable-qemu-reset-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ jobs:
insecure = true
http = true
EOF
earthly -P +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml
earthly -P +run-qemu-datasource-tests --PREBUILT_ISO=$(ls kairos-core-*${{ inputs.flavor }}*.iso) --TEST_SUITE=reset-test --FLAVOR=${{ inputs.flavor }}
16 changes: 8 additions & 8 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,18 @@ all-arm-generic:
BUILD --platform=linux/arm64 +base-image --MODEL=generic
BUILD --platform=linux/arm64 +iso --MODEL=generic

go-deps-test:
build-and-push-golang-testing:
ARG GO_VERSION
FROM golang:$GO_VERSION
# Enable backports repo for debian for swtpm
RUN . /etc/os-release && echo "deb http://deb.debian.org/debian $VERSION_CODENAME-backports main contrib non-free" > /etc/apt/sources.list.d/backports.list
RUN apt update
RUN apt install -y qemu-system-x86 qemu-utils git swtpm && apt clean
SAVE IMAGE --push $IMAGE_REPOSITORY_ORG/golang-testing:${GO_VERSION}

go-deps-test:
ARG GO_VERSION
FROM $IMAGE_REPOSITORY_ORG/golang-testing:$GO_VERSION
WORKDIR /build
COPY tests/go.mod tests/go.sum ./
RUN go mod download
Expand Down Expand Up @@ -874,8 +881,6 @@ grype-scan:
# usage e.g. ./earthly.sh +run-qemu-datasource-tests --FLAVOR=alpine-opensuse-leap --FROM_ARTIFACTS=true
run-qemu-datasource-tests:
FROM +go-deps-test
RUN apt update
RUN apt install -y qemu-system-x86 qemu-utils golang git swtpm
WORKDIR /test
ARG FLAVOR
ARG PREBUILT_ISO
Expand Down Expand Up @@ -922,9 +927,6 @@ run-qemu-netboot-test:
COPY +version/VERSION ./
ARG VERSION=$(cat VERSION)

RUN apt update
RUN apt install -y qemu-utils qemu-system git swtpm && apt clean

# This is the IP at which qemu vm can see the host
ARG IP="10.0.2.2"

Expand All @@ -951,8 +953,6 @@ run-qemu-netboot-test:

run-qemu-test:
FROM +go-deps-test
RUN apt update
RUN apt install -y qemu-system-x86 qemu-utils git swtpm && apt clean
ARG FLAVOR
ARG TEST_SUITE=upgrade-with-cli
ARG PREBUILT_ISO
Expand Down
Loading