diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 5d45582..0596d55 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -1,7 +1,10 @@ name: Development on: push: - pull_request: + tags: + - '*.*.*' + # pull_request: + workflow_dispatch: jobs: build: runs-on: ubuntu-latest @@ -9,57 +12,37 @@ jobs: matrix: include: - distro: alpine - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.11' platform: linux/amd64 - distro: alpine - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.10' platform: linux/amd64 - distro: alpine - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.9' platform: linux/amd64 - distro: alpine - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.8' platform: linux/amd64 - - distro: alpine - conda_ver: '22.11.1' - py_ver: '3.7' - platform: linux/amd64 - distro: debian - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.11' platform: linux/amd64 - distro: debian - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.10' platform: linux/amd64 - distro: debian - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.9' platform: linux/amd64 - distro: debian - conda_ver: '22.11.1' + conda_ver: '23.5.2' py_ver: '3.8' platform: linux/amd64 - - distro: debian - conda_ver: '22.11.1' - py_ver: '3.7' - platform: linux/amd64 - # - distro: debian - # conda_ver: 4.10.3 - # py_ver: 3.9 - # platform: linux/arm64 - # - distro: debian - # conda_ver: 4.10.3 - # py_ver: 3.8 - # platform: linux/arm64 - # - distro: debian - # conda_ver: 4.10.3 - # py_ver: 3.7 - # platform: linux/arm64 env: DISTRO: ${{matrix.distro}} CONDA_VER: ${{matrix.conda_ver}} @@ -110,9 +93,6 @@ jobs: - distro: alpine py_ver: '3.8' platform: linux/amd64 - - distro: alpine - py_ver: '3.7' - platform: linux/amd64 - distro: debian py_ver: '3.11' platform: linux/amd64 @@ -125,18 +105,6 @@ jobs: - distro: debian py_ver: '3.8' platform: linux/amd64 - - distro: debian - py_ver: '3.7' - platform: linux/amd64 - # - distro: debian - # py_ver: 3.9 - # platform: linux/arm64 - # - distro: debian - # py_ver: 3.8 - # platform: linux/arm64 - # - distro: debian - # py_ver: 3.7 - # platform: linux/arm64 env: DISTRO: ${{matrix.distro}} PY_VER: ${{matrix.py_ver}} diff --git a/config/.env b/config/.env index 0bfe8f9..8b37957 100644 --- a/config/.env +++ b/config/.env @@ -1,21 +1,21 @@ ## build # PY_VER='3.11' -# CONDA_VER=22.11.1 +# CONDA_VER=23.5.2 PY_VER='3.10' -CONDA_VER=22.11.1 +CONDA_VER=23.5.2 # PY_VER=3.9 -# CONDA_VER=22.11.1 +# CONDA_VER=23.5.2 # PY_VER=3.8 -# CONDA_VER=22.11.1 +# CONDA_VER=23.5.2 # PY_VER=3.7 -# CONDA_VER=22.11.1 +# CONDA_VER=23.5.2 -BASE_IMAGE_HASH=270a9fc +BASE_IMAGE_HASH=3206516 diff --git a/tests/main.sh b/tests/main.sh index 1462bcb..6ec7bd1 100755 --- a/tests/main.sh +++ b/tests/main.sh @@ -44,32 +44,23 @@ TAG=$(echo $REF | awk -F':' '{print $2}') IMAGE=$(echo $REF | awk -F':' '{print $1}') SHELL_CMD_TEMPLATE="docker run --rm -i \$SHELL_CMD_FLAGS $REF \ $(docker inspect "$REF" --format '{{join .Config.Cmd " "}}') -c" -# determine reference size -if [ $DISTRO == alpine ] && [ $PY_VER == '3.11' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=774 -elif [ $DISTRO == alpine ] && [ $PY_VER == '3.10' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=543 -elif [ $DISTRO == alpine ] && [ $PY_VER == '3.9' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=533 -elif [ $DISTRO == alpine ] && [ $PY_VER == '3.8' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=516 -elif [ $DISTRO == alpine ] && [ $PY_VER == '3.7' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=481 -elif [ $DISTRO == debian ] && [ $PY_VER == '3.11' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=897 -elif [ $DISTRO == debian ] && [ $PY_VER == '3.10' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=666 -elif [ $DISTRO == debian ] && [ $PY_VER == '3.9' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=655 -elif [ $DISTRO == debian ] && [ $PY_VER == '3.8' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=638 -elif [ $DISTRO == debian ] && [ $PY_VER == '3.7' ] && [ $PLATFORM == 'linux/amd64' ]; then - SIZE_LIMIT=603 -fi -SIZE_LIMIT=$(echo "scale=4; $SIZE_LIMIT * 1.05" | bc) -# verify size minimal -SIZE=$(docker images --filter "reference=$REF" --format "{{.Size}}" | awk -F'MB' '{print $1}') +# Get the compressed size of the last build from docker hub +LAST_BUILD_SIZE=$(curl -s https://hub.docker.com/v2/repositories/$IMAGE/tags \ + | jq -r '.results[] | select(.name=="py'"$PY_VER"'-'"$DISTRO"'") | .images[0].size') +SIZE_INCRESE_FACTOR=1.5 +SIZE_LIMIT=$(echo "scale=4; $LAST_BUILD_SIZE * $SIZE_INCRESE_FACTOR" | bc) +# Verify size minimal +echo Compressing image for size verification... +docker save $REF | gzip > /tmp/$TAG.tar.gz +SIZE=$(ls -al /tmp | grep $TAG.tar.gz | awk '{ print $5 }') +echo -e \ + Size comparison:\\n\ + Current size: $(numfmt --to iec --format "%8.4f" $SIZE)\\n\ + Last build size: $(numfmt --to iec --format "%8.4f" $LAST_BUILD_SIZE)\\n\ + Size factor: $SIZE_INCRESE_FACTOR\\n\ + Size limit: $(numfmt --to iec --format "%8.4f" $SIZE_LIMIT) assert "minimal footprint" "(( $(echo "$SIZE <= $SIZE_LIMIT" | bc -l) ))" $LINENO +rm /tmp/$TAG.tar.gz # run tests SHELL_CMD=$(eval "echo \"$SHELL_CMD_TEMPLATE\"") validate