Skip to content

Commit

Permalink
Fix create-env testing for all architectures
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull committed Oct 18, 2023
1 parent 3cc8630 commit ac2fffc
Showing 1 changed file with 39 additions and 37 deletions.
76 changes: 39 additions & 37 deletions .github/workflows/create-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,26 @@ jobs:
- name: Test
run: |
set -x
image='${{ steps.build.outputs.image }}'
ids="$(
for tag in ${{ steps.build.outputs.tags }} ; do
buildah manifest inspect "${image}:${tag}" \
| jq -r '.manifests[]|.digest' \
| while read id ; do
buildah images --format '{{.ID}}{{.Digest}}' \
| sed -n "s/${id}//p"
done
done
)"
ids="$( printf %s "${ids}" | sort -u )"
for id in ${ids} ; do
podman history "${id}"
buildah bud \
--build-arg=base="${id}" \
--file=Dockerfile.test \
"images/${image}"
done
for tag in ${{ steps.build.outputs.tags }} ; do
buildah manifest inspect \
"${image}:${tag}" \
| jq '.manifests|{([.[].digest]|sort|join("+")): [.[]|["'"${tag}"'", .platform.architecture, .digest]|join(" ")]}'
done \
| jq -rs 'add|add[]' \
| while read tag arch digest ; do
podman images --format='{{.ID}}|{{.Digest}}|{{.RepoDigests}}' \
| sed -n "/${digest}/{s/|.*//p;q}" \
| xargs -n1 -- \
sh -xc \
'podman history "${1}" ; podman inspect "${1}"' --
buildah bud \
--arch="${arch}" \
--build-arg=base="${image}:${tag}" \
--file=Dockerfile.test \
"images/${image}"
done
buildah rmi --prune || true
- name: Check Tags
Expand Down Expand Up @@ -121,23 +122,24 @@ jobs:
- if: ${{ github.ref == 'refs/heads/main' }}
name: Test Pushed
run: |
image='${{ env.IMAGE_NAME }}'
ids="$(
for tag in ${{ steps.build.outputs.tags }} ; do
buildah manifest inspect "${image}:${tag}" \
| jq -r '.manifests[]|.digest' \
| while read id ; do
buildah images --format '{{.ID}}{{.Digest}}' \
| sed -n "s/${id}//p"
done
done
)"
ids="$( printf %s "${ids}" | sort -u )"
for id in ${ids} ; do
podman history "${id}"
buildah bud \
--build-arg=base="${id}" \
--file=Dockerfile.test \
"images/${image}"
done
set -x
image='${{ steps.build.outputs.image }}'
for tag in ${{ steps.build.outputs.tags }} ; do
buildah manifest inspect \
"${image}:${tag}" \
| jq '.manifests|{([.[].digest]|sort|join("+")): [.[]|["'"${tag}"'", .platform.architecture, .digest]|join(" ")]}'
done \
| jq -rs 'add|add[]' \
| while read tag arch digest ; do
podman images --format='{{.ID}}|{{.Digest}}|{{.RepoDigests}}' \
| sed -n "/${digest}/{s/|.*//p;q}" \
| xargs -n1 -- \
sh -xc \
'podman history "${1}" ; podman inspect "${1}"' --
buildah bud \
--arch="${arch}" \
--build-arg=base="${image}:${tag}" \
--file=Dockerfile.test \
"images/${image}"
done
buildah rmi --prune || true

0 comments on commit ac2fffc

Please sign in to comment.