Skip to content

Commit 2ecbf6c

Browse files
author
Per Goncalves da Silva
committed
update e2e gha
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 0747bd0 commit 2ecbf6c

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

.github/workflows/e2e-tests.yml

+15-16
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,20 @@ jobs:
1313
# Build the OLM image and save it as an artifact
1414
build:
1515
runs-on: ubuntu-latest
16-
outputs:
17-
sha: ${{ steps.vars.outputs.sha }}
1816
steps:
1917
# checkout code and setup go
2018
- uses: actions/checkout@v4
2119
- uses: actions/setup-go@v5
2220
with:
2321
go-version-file: "go.mod"
2422
# build binaries and image for e2e test (includes experimental features)
25-
- name: Build controller image
26-
run: make e2e-build
27-
- name: Save image
28-
run: docker save quay.io/operator-framework/olm:local -o olm-image.tar
29-
- name: Upload Docker image as artifact
23+
- name: Build OLM Image
24+
run: make e2e-build save-image
25+
- name: Upload Artifacts
3026
uses: actions/upload-artifact@v4
3127
with:
32-
name: olm-image.tar
33-
path: olm-image.tar
28+
name: docker-images
29+
path: "*.tar.gz"
3430

3531
# Run e2e tests in parallel jobs
3632
# Take olm image from the previous stage
@@ -53,14 +49,17 @@ jobs:
5349
- uses: actions/setup-go@v5
5450
with:
5551
go-version-file: "go.mod"
56-
57-
# load the olm image
58-
- name: Load OLM Docker image
52+
- name: Download build artifacts
5953
uses: actions/download-artifact@v4
6054
with:
61-
name: olm-image.tar
62-
path: .
63-
- run: docker load < olm-image.tar
55+
name: docker-images
56+
path: images/
57+
- name: Load Docker images
58+
run: |
59+
for image in images/*.tar.gz; do
60+
echo "Loading image $image"
61+
docker load -i $image
62+
done
6463
6564
# set e2e environment variables
6665
# Set ginkgo output and parallelism
@@ -87,7 +86,7 @@ jobs:
8786
KIND_CLUSTER_NAME="kind-olmv0-${i}" \
8887
KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
8988
HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
90-
make kind-create deploy;
89+
make kind-create load-test-images deploy;
9190
done
9291
9392
# run non-flakes if matrix-id is not 'flakes'

Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,20 @@ image: export GOOS = linux
145145
image: clean build #HELP Build image image for linux on host architecture
146146
docker build -t $(IMAGE_REPO):$(IMAGE_TAG) -f Dockerfile bin
147147

148+
.PHONY: save-image
149+
TARGZ_FILE ?= olm-image.tar.gz
150+
save-image:
151+
docker save $(IMAGE_REPO):$(IMAGE_TAG) | gzip > "$(TARGZ_FILE)"
152+
153+
148154
.PHONE: build-e2e-fixture-images
149155
build-e2e-fixture-images: #HELP Build images for e2e testing
150156
./scripts/e2e_test_fixtures.sh
151157

152158
.PHONY: e2e-build
153159
# the e2e and experimental_metrics tags are required to get e2e tests to pass
154160
# search the code for go:build e2e or go:build experimental_metrics to see where these tags are used
161+
155162
e2e-build: export GO_BUILD_TAGS += e2e experimental_metrics #HELP Build image for e2e testing
156163
e2e-build: IMAGE_TAG = local
157164
e2e-build: image
@@ -215,8 +222,9 @@ kind-create: kind-clean #HELP Create a new kind cluster $KIND_CLUSTER_NAME (defa
215222
$(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME)
216223

217224
.PHONY: load-test-images
225+
export REGISTRY := localhost:5001
218226
load-test-images: #HELP Load the OLM images into the kind cluster's registry
219-
./scripts/e2e_test_fixtures.sh --push-to="localhost:5001"
227+
./scripts/e2e_test_fixtures.sh --push-to="$(REGISTRY)"
220228

221229
.PHONY: deploy
222230
OLM_IMAGE ?= $(IMAGE_REPO):$(IMAGE_TAG)

0 commit comments

Comments
 (0)