Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ jobs:

- name: Install container-structure-test
run: |
if [[ "${{ matrix.platform }}" == *"arm64"* ]]; then
curl -LO https://github.com/GoogleContainerTools/container-structure-test/releases/latest/download/container-structure-test-linux-arm64 && chmod +x container-structure-test-linux-arm64 && sudo mv container-structure-test-linux-arm64 /usr/local/bin/container-structure-test
else
curl -LO https://github.com/GoogleContainerTools/container-structure-test/releases/latest/download/container-structure-test-linux-amd64 && chmod +x container-structure-test-linux-amd64 && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
fi
if [ "${{ matrix.platform }}" == "linux/arm64" ]; then
ARCH="arm64"
else
ARCH="amd64"
fi
curl -LO "https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-${ARCH}"
chmod +x "container-structure-test-linux-${ARCH}"
sudo mv "container-structure-test-linux-${ARCH}" /usr/local/bin/container-structure-test

- name: Run tests
run: |
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/test.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
&& export SHFMT_VERSION=$(curl -s https://api.github.com/repos/mvdan/sh/releases/latest | jq -r '.tag_name') \
&& if [ "$(uname -m)" = "aarch64" ]; then \
curl -o /usr/local/bin/snyk -L https://static.snyk.io/cli/latest/snyk-linux-arm64 \
&& curl -o /usr/local/bin/hadolint -L https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-Linux-arm64 \
&& curl -o /usr/local/bin/hadolint -L https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-linux-arm64 \
&& curl -o /usr/local/bin/shfmt -L https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_arm64 \
&& curl -sL "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_arm64.tar.gz" | tar -xzf - -C /usr/local/bin actionlint ; \
else \
curl -o /usr/local/bin/snyk -L https://static.snyk.io/cli/latest/snyk-linux \
&& curl -o /usr/local/bin/hadolint -L https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-Linux-x86_64 \
&& curl -o /usr/local/bin/hadolint -L https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-linux-x86_64 \
&& curl -o /usr/local/bin/shfmt -L https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64 \
&& curl -sL "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | tar -xzf - -C /usr/local/bin actionlint ; \
fi \
Expand Down
10 changes: 5 additions & 5 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ build_and_test() {
docker run --platform "$platform" --rm "$TEST_PLATFORM_IMAGE" uname -m

# Conditionally add --platform flag
PLATFORM_ARG=""
PLATFORM_ARG=()
if [ -n "$PLATFORM_FLAG" ]; then
PLATFORM_ARG="--platform $platform"
PLATFORM_ARG=(--platform "$platform")
fi

if [ "$platform" == "linux/amd64" ]; then
container-structure-test test "$PLATFORM_ARG" --image "$TEST_PLATFORM_IMAGE" --config tests/amd64.yaml
container-structure-test test "${PLATFORM_ARG[@]}" --image "$TEST_PLATFORM_IMAGE" --config tests/amd64.yaml
else
container-structure-test test "$PLATFORM_ARG" --image "$TEST_PLATFORM_IMAGE" --config tests/arm64.yaml
container-structure-test test "${PLATFORM_ARG[@]}" --image "$TEST_PLATFORM_IMAGE" --config tests/arm64.yaml
fi

# Run the tests
container-structure-test test "$PLATFORM_ARG" --image "$TEST_PLATFORM_IMAGE" --config tests/specs.yaml
container-structure-test test "${PLATFORM_ARG[@]}" --image "$TEST_PLATFORM_IMAGE" --config tests/specs.yaml

# Clean up
docker rmi $TEST_IMAGE:"$tag" || true
Expand Down