Attempt to add test coverage to multiarch.yml GHA workflow (nb: this depends on step uniqueness being determined at runtime rather than statically)

This commit is contained in:
James Addison 2021-10-10 17:56:16 +01:00
parent 67b5cfd072
commit 21dec7e3bb

View file

@ -19,6 +19,7 @@ jobs:
matrix:
arch: [ amd64, i386, arm64v8 ]
install_latest: [ true, false ]
specify_platform: [ false, true ]
steps:
@ -38,7 +39,8 @@ jobs:
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Create Containerfile
- name: Create Containerfile (arch=${{ matrix.arch }})
if: !matrix.specify_platform
run: |
cat > Containerfile<<EOF
@ -50,7 +52,20 @@ jobs:
ENTRYPOINT [ "sh", "-c", "echo -n 'Machine: ' && uname -m && echo -n 'Bits: ' && getconf LONG_BIT && echo 'goodbye world'" ]
EOF
- name: Build Image
- name: Create Containerfile (platform=linux/${{ matrix.arch }})
if: matrix.specify_platform
run: |
cat > Containerfile<<EOF
FROM docker.io/alpine:3.14
RUN echo "hello world"
ENTRYPOINT [ "sh", "-c", "echo -n 'Machine: ' && uname -m && echo -n 'Bits: ' && getconf LONG_BIT && echo 'goodbye world'" ]
EOF
- name: Build Image (arch=${{ matrix.arch }})
if: !matrix.specify_platform
id: build_image
uses: ./buildah-build/
with:
@ -61,6 +76,17 @@ jobs:
containerfiles: |
./Containerfile
- name: Build Image (platform=linux/${{ matrix.arch }})
if: matrix.specify_platform
id: build_image
uses: ./buildah-build/
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAG }}
platform: linux/${{ matrix.arch }}
containerfiles: |
./Containerfile
- name: Echo Outputs
run: |
echo "Image: ${{ steps.build_image.outputs.image }}"