Skip to content

Commit

Permalink
add check for forge images
Browse files Browse the repository at this point in the history
  • Loading branch information
aluon committed Oct 18, 2024
1 parent 71e0302 commit 1ef2b66
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/workflow-run-forge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,33 @@ jobs:
shell: bash
run: gcloud config set project aptos-forge-gcp-0

- name: Check for Forge images
if: ${{ !inputs.SKIP_JOB }}
id: check-forge-images
run: |
check_image_exists() {
local tag=$1
local image_name=$2
local output_prefix=$3
if [[ -n "$tag" ]]; then
if docker manifest inspect us-docker.pkg.dev/aptos-registry/docker/${image_name}:${tag} &> /dev/null; then
echo "${output_prefix}_EXISTS=true" >> $GITHUB_OUTPUT
echo "${output_prefix}_TAG=$tag" >> $GITHUB_OUTPUT
echo "✅ $image_name image found for tag: $tag" >> $GITHUB_STEP_SUMMARY
else
echo "${output_prefix}_EXISTS=false" >> $GITHUB_OUTPUT
echo "⚠️ No $image_name image found for tag: $tag. The latest available image will be used instead." >> $GITHUB_STEP_SUMMARY
fi
fi
}
check_image_exists "${{ inputs.GIT_SHA }}" "validator" "VALIDATOR_GIT_SHA"
check_image_exists "${{ inputs.IMAGE_TAG }}" "validator" "VALIDATOR_IMAGE_TAG"
check_image_exists "${{ inputs.GIT_SHA }}" "forge" "FORGE_GIT_SHA"
check_image_exists "${{ inputs.FORGE_IMAGE_TAG }}" "forge" "FORGE_IMAGE_TAG"
echo "ℹ️ If testing Forge changes, ensure the 'CICD: build-images' label is added to your PR and the image build workflow has completed successfully." >> $GITHUB_STEP_SUMMARY
- name: Run pre-Forge checks
if: ${{ !inputs.SKIP_JOB }}
shell: bash
Expand Down Expand Up @@ -228,3 +255,4 @@ jobs:
# Print out whether the job was skipped.
- run: echo "Skipping forge test!"
if: ${{ inputs.SKIP_JOB }}

0 comments on commit 1ef2b66

Please sign in to comment.