Skip to content

Commit 2206b02

Browse files
committed
Run pre-commit checks in extra job
The build job is run for amd64 and arm64. However not all bazel dependencies are available for arm64 and thus these checks can only be run on amd64.
1 parent 6a30ddf commit 2206b02

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ concurrency:
2121
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2222
cancel-in-progress: true
2323
jobs:
24+
pre-commit:
25+
runs-on: ubuntu-24.04
26+
permissions:
27+
contents: read
28+
steps:
29+
- uses: actions/checkout@v6
30+
- uses: actions/setup-python@v6
31+
# code mostly taken from https://github.com/pre-commit/action/blob/main/action.yml
32+
- run: python -m pip install pre-commit==4.5.1
33+
shell: bash
34+
- run: python -m pip freeze --local
35+
shell: bash
36+
- uses: actions/cache@v5
37+
with:
38+
path: ~/.cache/pre-commit
39+
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
40+
- run: pre-commit run --show-diff-on-failure --color=always --all-files
41+
shell: bash
2442
build:
2543
strategy:
2644
matrix:
@@ -34,6 +52,7 @@ jobs:
3452
runner: ubuntu-24.04-arm
3553
name: ${{ matrix.name }}
3654
runs-on: ${{ matrix.runner }}
55+
needs: pre-commit
3756
permissions:
3857
contents: read
3958
packages: write
@@ -57,9 +76,6 @@ jobs:
5776
runCmd: |
5877
set -eux pipefail
5978
60-
# Check
61-
pre-commit run --show-diff-on-failure --color=always --all-files || exit 1
62-
6379
# Create builder for multi-arch builds
6480
./scripts/create_builder.sh
6581

src/s-core-devcontainer/test-project/test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# SPDX-License-Identifier: Apache-2.0
1414
# *******************************************************************************
1515

16-
#
1716
set -euo pipefail
1817

1918
source "test-utils.sh" vscode

0 commit comments

Comments
 (0)