@@ -48,15 +48,18 @@ jobs:
4848 - 'docs/**'
4949 - '*.md'
5050
51- build-ci-image :
52- name : Build CI Image
51+ build-ci-images :
52+ name : Build CI Image (Python ${{ matrix.python-version }})
5353 runs-on : ubuntu-latest
5454 timeout-minutes : 30
5555 needs : check-changes
5656 if : needs.check-changes.outputs.source-changed == 'true'
57+ strategy :
58+ fail-fast : false
59+ matrix :
60+ python-version : ["3.10", "3.11", "3.12", "3.13"]
5761 outputs :
58- image-tag : ${{ steps.meta.outputs.tags }}
59- image-digest : ${{ steps.build.outputs.digest }}
62+ image-tag-py${{ matrix.python-version }} : ${{ steps.meta.outputs.tags }}
6063 steps :
6164 - name : Free disk space
6265 run : |
8689 id : meta
8790 uses : docker/metadata-action@v5
8891 with :
89- images : ghcr.io/${{ github.repository }}/ci
92+ images : ghcr.io/${{ github.repository }}/ci-py${{ matrix.python-version }}
9093 tags : |
9194 type=sha,prefix={{branch}}-
9295
@@ -103,9 +106,11 @@ jobs:
103106 push : true
104107 tags : ${{ steps.meta.outputs.tags }}
105108 labels : ${{ steps.meta.outputs.labels }}
106- cache-from : type=gha
107- cache-to : type=gha,mode=max
109+ cache-from : type=gha,scope=py${{ matrix.python-version }}
110+ cache-to : type=gha,mode=max,scope=py${{ matrix.python-version }}
108111 outputs : type=registry,compression=zstd
112+ build-args : |
113+ PYTHON_VERSION=${{ matrix.python-version }}
109114 lint :
110115 name : Lint
111116 runs-on : ubuntu-latest
@@ -136,11 +141,11 @@ jobs:
136141 build-wheel :
137142 name : Build wheel (Linux x86_64, Python ${{ matrix.python-version }})
138143 runs-on : ubuntu-latest
139- needs : [check-changes, build-ci-image ]
144+ needs : [check-changes, build-ci-images ]
140145 if : needs.check-changes.outputs.source-changed == 'true'
141146 timeout-minutes : 30
142147 container :
143- image : ${{ needs.build- ci-image.outputs.image-tag }}
148+ image : ghcr.io/ ${{ github.repository }}/ ci-py${{ matrix.python-version }}:${{ github.ref_name }}-${{ github.sha }}
144149 credentials :
145150 username : ${{ github.actor }}
146151 password : ${{ secrets.GITHUB_TOKEN }}
@@ -169,11 +174,11 @@ jobs:
169174 build-docs :
170175 name : Build docs
171176 runs-on : ubuntu-latest
172- needs : [check-changes, build-ci-image , build-wheel]
177+ needs : [check-changes, build-ci-images , build-wheel]
173178 if : always() && (needs.check-changes.outputs.source-changed == 'true' || needs.check-changes.outputs.docs-changed == 'true')
174179 timeout-minutes : 15
175180 container :
176- image : ${{ needs.build- ci-image.outputs.image-tag }}
181+ image : ghcr.io/ ${{ github.repository }}/ ci-py3.10:${{ github.ref_name }}-${{ github.sha }}
177182 credentials :
178183 username : ${{ github.actor }}
179184 password : ${{ secrets.GITHUB_TOKEN }}
0 commit comments