Skip to content

Commit

Permalink
Simplify the images being used for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cscollett committed Aug 29, 2024
1 parent c52ce66 commit 5f44770
Showing 1 changed file with 18 additions and 39 deletions.
57 changes: 18 additions & 39 deletions .github/workflows/docker-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13.0rc1', 'latest']
debian-version: ['bullseye', 'bookworm', 'latest']
slim: [true, false]
image-tag: ['3.12-slim-bullseye', '3.13.0rc1', '3.13.0rc1-slim', 'latest']
update-strategy: [update, unlocked-install, latest-install]
exclude:
# Current installation covered in CI job
- python-version: '3.12'
debian-version: 'bullseye'
slim: true
# Current deployment using slim, no need to test.
- python-version: '3.12'
debian-version: 'bullseye'
slim: false

steps:
- name: Checkout code
Expand All @@ -34,35 +23,25 @@ jobs:
- name: Set up Docker Build
uses: docker/[email protected]

- name: Set image tag
run: |
if [ "${{ matrix.python-version }}" = "latest" ]; then
IMAGE_TAG="latest"
else
IMAGE_TAG="${{ matrix.python-version }}"
if [ "${{ matrix.slim }}" = "true" ]; then
IMAGE_TAG="${IMAGE_TAG}-slim"
fi
if [ "${{ matrix.debian-version }}" != "latest" ]; then
IMAGE_TAG="${IMAGE_TAG}-${{ matrix.debian-version }}"
fi
fi
echo "Using image tag: ${IMAGE_TAG}"
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
- name: Build current Docker image with tests
run: |
docker build --target test -t zephir-api2:test .

- name: Install and update dependencies
run: |
echo "Image tag: ${{ matrix.image-tag }}"
echo "Update strategy: ${{ matrix.update-strategy }}"
if [[ "${{ matrix.update-strategy }}" == "update" ]]; then
echo "Running normal test with updated dependencies"
docker build --no-cache --build-arg IMAGE_TAG=${{ env.IMAGE_TAG }} --target test-update -t zephir-api2:test .
echo "Running normal test with updated dependencies"
docker build --no-cache --build-arg IMAGE_TAG=${{ matrix.image-tag }} --target test-update -t zephir-api2:test .
elif [[ "${{ matrix.update-strategy }}" == "unlocked-install" ]]; then
echo "Running normal test with updated dependencies"
docker build --no-cache --build-arg IMAGE_TAG=${{ env.IMAGE_TAG }} --target build-unlocked-test -t zephir-api2:test .
echo "Running normal test with updated dependencies"
docker build --no-cache --build-arg IMAGE_TAG=${{ matrix.image-tag }} --target build-unlocked-test -t zephir-api2:test .
elif [[ "${{ matrix.update-strategy }}" == "latest-install" ]]; then
echo "Running normal test with updated dependencies"
docker build --no-cache --build-arg IMAGE_TAG=${{ env.IMAGE_TAG }} --target build-latest-test -t zephir-api2:test .
fi
echo "Running normal test with updated dependencies"
docker build --no-cache --build-arg IMAGE_TAG=${{ matrix.image-tag }} --target build-latest-test -t zephir-api2:test .
fi

0 comments on commit 5f44770

Please sign in to comment.