Skip to content

Commit cc76233

Browse files
ci: Add Docker image verification jobs to CI workflow
1 parent bd19161 commit cc76233

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/CI.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,40 @@ jobs:
5252
cybuerg/cfspeedtest:${{ github.sha }}
5353
cache-from: type=local,src=/tmp/.buildx-cache
5454
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
55+
outputs: type=docker,dest=/tmp/docker-image.tar
5556
- name: Move cache
5657
run: |
5758
rm -rf /tmp/.buildx-cache
5859
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
60+
- name: Upload Docker image as artifact
61+
uses: actions/upload-artifact@v3
62+
with:
63+
name: docker-image
64+
path: /tmp/docker-image.tar
65+
retention-days: 1
66+
67+
verify-docker-image:
68+
needs: docker-build
69+
runs-on: ubuntu-latest
70+
strategy:
71+
matrix:
72+
platform: [linux/amd64, linux/arm64]
73+
steps:
74+
- name: Download Docker image
75+
uses: actions/download-artifact@v3
76+
with:
77+
name: docker-image
78+
path: /tmp
79+
- name: Load Docker image
80+
run: |
81+
docker load < /tmp/docker-image.tar
82+
- name: Verify amd64 image
83+
if: matrix.platform == 'linux/amd64'
84+
run: |
85+
docker run --platform linux/amd64 cybuerg/cfspeedtest:${{ github.sha }} --help
86+
docker run --platform linux/amd64 --entrypoint /bin/sh cybuerg/cfspeedtest:${{ github.sha }} -c "file /usr/local/bin/cfspeedtest" | grep "x86-64"
87+
- name: Verify arm64 image
88+
if: matrix.platform == 'linux/arm64'
89+
run: |
90+
docker run --platform linux/arm64 cybuerg/cfspeedtest:${{ github.sha }} --help
91+
docker run --platform linux/arm64 --entrypoint /bin/sh cybuerg/cfspeedtest:${{ github.sha }} -c "file /usr/local/bin/cfspeedtest" | grep "aarch64"

0 commit comments

Comments
 (0)