Skip to content

Commit 953df9e

Browse files
committed
pre-commit job for release workflow
1 parent 2206b02 commit 953df9e

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/release.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ on:
1717
tags:
1818
- v[0-9]+.[0-9]+.[0-9]+
1919
jobs:
20+
pre-commit:
21+
runs-on: ubuntu-24.04
22+
permissions:
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v6
26+
- uses: actions/setup-python@v6
27+
# code mostly taken from https://github.com/pre-commit/action/blob/main/action.yml
28+
- run: python -m pip install pre-commit==4.5.1
29+
shell: bash
30+
- run: python -m pip freeze --local
31+
shell: bash
32+
- uses: actions/cache@v5
33+
with:
34+
path: ~/.cache/pre-commit
35+
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
36+
- run: pre-commit run --show-diff-on-failure --color=always --all-files
37+
shell: bash
2038
build:
2139
strategy:
2240
matrix:
@@ -30,6 +48,7 @@ jobs:
3048
runner: ubuntu-24.04-arm
3149
name: ${{ matrix.name }}
3250
runs-on: ${{ matrix.runner }}
51+
needs: pre-commit
3352
permissions:
3453
contents: read
3554
packages: write
@@ -53,9 +72,6 @@ jobs:
5372
runCmd: |
5473
set -eux pipefail
5574
56-
# Check
57-
pre-commit run --show-diff-on-failure --color=always --all-files || exit 1
58-
5975
# Create builder for multi-arch builds
6076
./scripts/create_builder.sh
6177

0 commit comments

Comments
 (0)