Skip to content

Commit

Permalink
Merge branch 'master' into windows-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Aug 29, 2024
2 parents 7f0ddd4 + d75df50 commit 33a820f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ jobs:
run: scripts/mock.gen.sh
- shell: bash
run: .github/workflows/check-clean-branch.sh
test_build_image:
name: Image build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check image build
shell: bash
run: bash -x scripts/tests.build_docker_image.sh
test_build_antithesis_images:
name: Build Antithesis images
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion scripts/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh

# WARNING: this will use the most recent commit even if there are un-committed changes present
BUILD_IMAGE_ID=${BUILD_IMAGE_ID:-"${CURRENT_BRANCH}"}
DOCKERHUB_TAG=${SUBNET_EVM_COMMIT::8}

VM_ID=${VM_ID:-"${DEFAULT_VM_ID}"}
if [[ "${VM_ID}" != "${DEFAULT_VM_ID}" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions scripts/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ else
SUBNET_EVM_COMMIT="$(git --git-dir="$SUBNET_EVM_PATH/.git" rev-parse HEAD || :)"
fi

# Shared between ./scripts/build_docker_image.sh and ./scripts/tests.build_docker_image.sh
DOCKERHUB_TAG=${SUBNET_EVM_COMMIT::8}

echo "Using branch: ${CURRENT_BRANCH}"

# Static compilation
Expand Down
19 changes: 19 additions & 0 deletions scripts/tests.build_docker_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -euo pipefail

# Sanity check the image build by attempting to build and run the image without error.

# Directory above this script
SUBNET_EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh

# Build a local image
"${SUBNET_EVM_PATH}"/scripts/build_docker_image.sh

# Check that the image can be run and contains the plugin
echo "Checking version of the plugin provided by the image"
docker run -t --rm "${DOCKERHUB_REPO}:${DOCKERHUB_TAG}" /avalanchego/build/plugins/"${DEFAULT_VM_ID}" --version
echo "" # --version output doesn't include a newline
echo "Successfully checked image build"

0 comments on commit 33a820f

Please sign in to comment.