Skip to content

Commit 07bb68c

Browse files
tpoliawabbiemery
authored andcommitted
Add test for docker version number
1 parent 5a55323 commit 07bb68c

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/_container.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ jobs:
5252
load: true
5353
tags: tag_for_testing
5454

55-
- name: Test cli works in cached runtime image
56-
run: docker run --rm tag_for_testing --version
57-
5855
- name: Create tags for publishing image
5956
id: meta
6057
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
@@ -64,6 +61,20 @@ jobs:
6461
type=ref,event=tag
6562
type=raw,value=latest
6663
64+
- name: Test cli works in cached runtime image
65+
id: app-version
66+
run: |
67+
APP_VERSION=$(docker run --rm tag_for_testing --version)
68+
echo "Version in built container: $APP_VERSION"
69+
echo "version=$APP_VERSION" >> "$GITHUB_OUTPUT"
70+
71+
- name: Check versions match
72+
if: github.ref_type == 'tag'
73+
run: '[[ "$APP_VERSION" = "blueapi, version $REPO_VERSION" ]]'
74+
env:
75+
APP_VERSION: ${{ steps.app-version.outputs.version }}
76+
REPO_VERSION: ${{ steps.meta.outputs.version }}
77+
6778
- name: Push cached image to container registry
6879
if: github.ref_type == 'tag'
6980
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6

0 commit comments

Comments
 (0)