diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bd6ad7bf4..5eaaf1dfe9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,8 @@ jobs: matrix: ${{ fromJson(needs.get-matrix.outputs.matrix-linux) }} steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Need full history for voom like versions - name: Build run: | export ${{ matrix.IMPL }} diff --git a/Makefile b/Makefile index 7cfd86809d..acad2220d6 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ STEP_TEST_FILES = $(strip $(wildcard \ # DOCKERIZE utility functions lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) -impl_to_image = kanaka/mal-test-$(call lc,$(1)) +impl_to_image = kanaka/mal-test-$(call lc,$(1)):$(shell ./voom-like-version.sh impls/$(1)/Dockerfile) actual_impl = $(if $(filter mal,$(1)),$(patsubst %-mal,%,$(MAL_IMPL)),$(1)) diff --git a/ci.sh b/ci.sh index 400045fbeb..5885ae6772 100755 --- a/ci.sh +++ b/ci.sh @@ -52,9 +52,10 @@ echo "TEST_OPTS: ${TEST_OPTS}" # the Travis/Github Actions image/tools directly. if [ -z "${NO_DOCKER}" ]; then img_impl=$(echo "${MAL_IMPL:-${IMPL}}" | tr '[:upper:]' '[:lower:]') + img_ver=$(./voom-like-version.sh impls/${img_impl}/Dockerfile) # We could just use make DOCKERIZE=1 instead but that does add # non-trivial startup overhead for each step. - MAKE="docker run -i -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl%%-mal} ${MAKE}" + MAKE="docker run -i -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl%%-mal}:${img_ver} ${MAKE}" fi case "${ACTION}" in diff --git a/voom-like-version.sh b/voom-like-version.sh new file mode 100755 index 0000000000..9e85e92770 --- /dev/null +++ b/voom-like-version.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +echo $(TZ=UTC git log -1 --pretty=%ad-g%h --date=format-local:"%Y%m%d_%H%M%S" -- "$@")$(test -z "$(git status --short -- "$@")" || echo _DIRTY)