Skip to content

Commit

Permalink
Add build tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
  • Loading branch information
pierDipi committed Feb 13, 2025
1 parent de31c89 commit 88e7ffe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 2 additions & 0 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
source "$(dirname $0)/common.sh"

build_transform_jsonata_image || exit 1

build_integration_images || exit 1
6 changes: 5 additions & 1 deletion hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readonly REPO_ROOT_DIR
function build_transform_jsonata_image() {
local image="${KO_DOCKER_REPO}/transform-jsonata:${TAG}"

docker buildx build \
docker build \
--platform linux/amd64,linux/arm64 \
-t "${image}" \
-f "${REPO_ROOT_DIR}/transform-jsonata/Dockerfile" \
Expand All @@ -21,3 +21,7 @@ function build_transform_jsonata_image() {
TRANSFORM_JSONATA_IMAGE=$(docker inspect --format '{{index .RepoDigests 0}}' "${image}")
export TRANSFORM_JSONATA_IMAGE
}

function build_integration_images() {
"${REPO_ROOT_DIR}/mvnw" clean package -P knative -DskipTests || return $?
}
2 changes: 1 addition & 1 deletion hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function build_release() {

# KO_DOCKER_REPO and TAG are calculated in release.sh script

./mvnw clean package -P knative -DskipTests || return $?
build_integration_images || return $?

# use the function so that the exported TRANSFORM_JSONATA_IMAGE is visible after during generate_transformation_configMap
build_transform_jsonata_image || return $?
Expand Down
13 changes: 9 additions & 4 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env bash

# TODO a placeholder script to CI automation.
# Can be used to execute integration tests in the future.
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script presubmit-tests.sh)"
source "$(go run knative.dev/hack/cmd/script infra-library.sh)"
source "$(go run knative.dev/hack/cmd/script e2e-tests.sh)"

./hack/build.sh
function build_tests() {
header "Running build tests"
./hack/build.sh || fail_test "build tests failed"
}

true
main $@

0 comments on commit 88e7ffe

Please sign in to comment.