1111 workflow_call :
1212 workflow_dispatch :
1313
14+ permissions : {}
15+
16+ concurrency :
17+ group : ${{ github.workflow }}-${{ github.ref }}
18+ cancel-in-progress : ${{ github.ref_name != github.event.repository.default_branch }}
19+
1420jobs :
1521 python :
1622 strategy :
1723 matrix :
1824 os : [ubuntu-latest, macos-latest, windows-latest]
1925 python : [3.12]
2026
21- name : python
2227 runs-on : ${{ matrix.os }}
2328 env :
2429 ENVIRONMENT : ci
2530 steps :
26- - name : Checkout
27- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
31+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2832
29- - name : Set up UV
30- uses : astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5
33+ - uses : astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5
3134
32- - name : Set up Python
33- id : setup-python
35+ - id : setup-python
3436 uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
3537 with :
3638 python-version : ${{ matrix.python }}
@@ -39,39 +41,35 @@ jobs:
3941 if : ${{ runner.os != 'Windows' }}
4042 run : |
4143 mkdir -p .venv
42- echo "$(realpath .venv)/bin" >> ${GITHUB_PATH}
44+ echo "$(realpath .venv)/bin" >> " ${GITHUB_PATH}"
4345
4446 - name : Set up environment (Windows)
4547 if : ${{ runner.os == 'Windows' }}
4648 run : |
4749 New-Item -Type Directory -Force .venv
48- "$(Resolve-Path .venv)/Scripts" | Out-File -FilePath ${env:GITHUB_PATH} -Append
50+ "$(Resolve-Path .venv)/Scripts" | Out-File -FilePath " ${env:GITHUB_PATH}" -Append
4951
50- - name : Install dependencies
51- run : uv sync
52+ - run : uv sync
5253
53- - name : Lint and test
54- run : make lint test
54+ - run : make lint test
5555
5656 docker :
57- name : docker
5857 permissions :
5958 contents : read
6059 packages : write
60+
6161 runs-on : ubuntu-latest
6262 env :
6363 GHCR_IMAGE_NAME : ghcr.io/${{ github.repository }}
6464
6565 steps :
66- - name : Checkout
67- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
66+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
6867 with :
6968 sparse-checkout : |
7069 Dockerfile
7170 uv.lock
7271
73- - name : Cache buildkit mounts
74- uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
72+ - uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
7573 with :
7674 path : |
7775 var-cache-apt
8280 buildkit-mounts-${{ runner.os }}
8381 buildkit-mounts-${{ runner.os }}
8482
85- - name : Inject cache into docker
86- uses : reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3
83+ - uses : reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de # v3
8784 with :
8885 cache-map : |
8986 {
9390 "root-cache-uv": "/root/.cache/uv"
9491 }
9592
96- - name : Set up Docker Buildx
97- uses : docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3
93+ - uses : docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3
9894
99- - name : Build CI image
100- id : build-ci
95+ - id : build-ci
10196 env :
10297 ENVIRONMENT : ci
10398 uses : docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
@@ -108,25 +103,21 @@ jobs:
108103 ${{ env.GHCR_IMAGE_NAME }}:cache
109104 load : true
110105
111- - name : Run CI image
112- run : docker run --rm ${{ steps.build-ci.outputs.imageid }}
106+ - run : docker run --rm ${{ steps.build-ci.outputs.imageid }}
113107
114- - name : Docker metadata
115- id : docker_metadata
108+ - id : docker_metadata
116109 uses : docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5
117110 with :
118111 images : ${{ env.GHCR_IMAGE_NAME }}
119112
120- - name : Login to GHCR
121- if : ${{ github.event_name != 'pull_request' }}
113+ - if : ${{ github.event_name != 'pull_request' }}
122114 uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
123115 with :
124116 registry : ghcr.io
125117 username : ${{ github.repository_owner }}
126118 password : ${{ secrets.GITHUB_TOKEN }}
127119
128- - name : Build and push dev image
129- if : ${{ github.event_name != 'pull_request' }}
120+ - if : ${{ github.event_name != 'pull_request' }}
130121 env :
131122 ENVIRONMENT : dev
132123 uses : docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
@@ -139,10 +130,7 @@ jobs:
139130 tags : ${{ env.GHCR_IMAGE_NAME }}:dev
140131 push : ${{ github.event_name != 'pull_request' }}
141132
142- - name : Build and push prod image
143- if : ${{ github.event_name != 'pull_request' }}
144- env :
145- ENVIRONMENT : prod
133+ - if : ${{ github.event_name != 'pull_request' }}
146134 uses : docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
147135 with :
148136 cache-from : |
@@ -153,3 +141,5 @@ jobs:
153141 labels : ${{ steps.docker_metadata.outputs.labels }}
154142 annotations : ${{ steps.docker_metadata.outputs.annotations }}
155143 push : ${{ github.event_name != 'pull_request' }}
144+ env :
145+ ENVIRONMENT : prod
0 commit comments