Skip to content

Commit

Permalink
github/workflows : fail test_suite_pr if PR images are not pushed yet
Browse files Browse the repository at this point in the history
Signed-off-by: Shahriyar Jalayeri <[email protected]>
  • Loading branch information
shjala committed Nov 10, 2023
1 parent b1fd32d commit 0a83115
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/eden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,28 @@ concurrency:
cancel-in-progress: true

jobs:
check_pr_publish:
runs-on: ubuntu-latest
steps:
- name: Check Image Availability
run: |
DOCKER_HUB_PATH="evebuild/danger"
# currently we only test amd64 (kvms and xen) with Eden
IMAGE_AMD64_XEN="pr${{ github.event.pull_request.number }}-xen"
IMAGE_AMD64_KVM="pr${{ github.event.pull_request.number }}-kvm"
amd64_xen_res=$(curl -s "https://hub.docker.com/v2/repositories/${DOCKER_HUB_PATH}/tags/${IMAGE_AMD64_XEN}")
amd64_kvm_res=$(curl -s "https://hub.docker.com/v2/repositories/${DOCKER_HUB_PATH}/tags/${IMAGE_AMD64_KVM}")
if [[ "$(echo "$amd64_xen_res" | jq -r '.name')" == "${IMAGE_AMD64_XEN}" && "$(echo "$amd64_kvm_res" | jq -r '.name')" == "${IMAGE_AMD64_KVM}" ]]; then
echo "Docker image ${DOCKER_HUB_PATH}:${IMAGE_AMD64_XEN} and ${DOCKER_HUB_PATH}:${IMAGE_AMD64_KVM} are available on Docker Hub."
exit 0
else
echo "Docker image ${DOCKER_HUB_PATH}:${IMAGE_AMD64_XEN} and ${DOCKER_HUB_PATH}:${IMAGE_AMD64_KVM} are not available on Docker Hub."
exit 1
fi
test_suite_pr:
needs: check_pr_publish
if: github.event.review.state == 'approved'
uses: lf-edge/eden/.github/workflows/[email protected]
with:
Expand Down

0 comments on commit 0a83115

Please sign in to comment.