68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
name: ChangeDetection.io Container Build Test
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- requirements.txt
|
|
- Dockerfile
|
|
- .github/workflows/*
|
|
- .github/test/Dockerfile*
|
|
|
|
pull_request:
|
|
paths:
|
|
- requirements.txt
|
|
- Dockerfile
|
|
- .github/workflows/*
|
|
- .github/test/Dockerfile*
|
|
|
|
jobs:
|
|
test-container-build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python_version: [3.11, 3.12, 3.13]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python_version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python_version }}
|
|
|
|
# Set up QEMU
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
image: tonistiigi/binfmt:latest
|
|
platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
install: true
|
|
version: latest
|
|
driver-opts: image=moby/buildkit:master
|
|
|
|
# Musl (alpine) build test (runs once per matrix job, or can skip with conditional if needed)
|
|
- name: Test that the docker containers can build (musl via alpine check)
|
|
id: docker_build_musl
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./
|
|
file: ./.github/test/Dockerfile-alpine
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
# Main build with matrix Python version
|
|
- name: Test that the docker containers can build (Python ${{ matrix.python_version }})
|
|
id: docker_build
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8,linux/arm64/v8,linux/aarch64
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
build-args: |
|
|
PYTHON_VERSION=${{ matrix.python_version }}
|