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

Add build tests #67

Merged
merged 7 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ trap 'err_report $LINENO' ERR

build_transform_jsonata_image || exit $?

build_integration_images || exit $?
# TODO: To enable the builds in build-tests we need to disable the "push"
# build_integration_images || exit $?
Comment on lines +21 to +22
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the integration images build is trying to push to KO_DOCKER_REPO, so we can enable them later when we figure this out

8 changes: 6 additions & 2 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ set -euo pipefail

export TAG=${TAG:-$(git rev-parse HEAD)}

export KO_DOCKER_REPO="${KO_DOCKER_REPO:-kind.local}"
export TRANSFORM_JSONATA_IMAGE_WITH_TAG="${KO_DOCKER_REPO}/transform-jsonata:${TAG}"
export TRANSFORM_JSONATA_IMAGE_WITH_TAG="${KO_DOCKER_REPO:-kind.local}/transform-jsonata:${TAG}"

[[ ! -v REPO_ROOT_DIR ]] && REPO_ROOT_DIR="$(git rev-parse --show-toplevel)"
readonly REPO_ROOT_DIR

export TRANSFORM_JSONATA_DIR="${REPO_ROOT_DIR}/transform-jsonata"


function build_transform_jsonata_image() {

if (( ${IS_PROW:-0} )); then
docker run --privileged --rm tonistiigi/binfmt --install all binfmt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the multi-arch builder image?

Copy link
Member Author

@pierDipi pierDipi Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's installing qemu packages so that docker buildx can emulate instructions for other platforms

fi

docker info
docker buildx ls

Expand Down
2 changes: 1 addition & 1 deletion test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# 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)"

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

Expand Down