Skip to content

Commit fc5b213

Browse files
authored
[CI] Fix 'pre-commit' job influence on the rest of the pre-commit pipeline (learning-process#501)
1 parent 64ea0a9 commit fc5b213

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

.github/workflows/pre-commit.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pre-commit checks
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pre-commit:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
submodules: recursive
13+
fetch-depth: 0
14+
- name: Setup environment
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install --no-install-recommends -y \
18+
gcc-14 g++-14 ninja-build python3-pip clang-format-16
19+
python3 -m pip install -r requirements.txt
20+
- name: Run pre-commit checks
21+
run: |
22+
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
23+
pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD

.github/workflows/ubuntu.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,7 @@ on:
22
workflow_call:
33

44
jobs:
5-
pre-commit:
6-
runs-on: ubuntu-24.04
7-
if: github.event_name != 'push'
8-
steps:
9-
- uses: actions/checkout@v4
10-
with:
11-
submodules: recursive
12-
fetch-depth: 0
13-
- name: Setup environment
14-
run: |
15-
sudo apt-get update
16-
sudo apt-get install --no-install-recommends -y \
17-
gcc-14 g++-14 ninja-build python3-pip clang-format-16
18-
python3 -m pip install -r requirements.txt
19-
- name: Run pre-commit checks
20-
run: |
21-
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
22-
pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD
235
gcc-build:
24-
needs:
25-
- pre-commit
266
runs-on: ${{ matrix.os }}
277
strategy:
288
matrix:
@@ -130,8 +110,6 @@ jobs:
130110
env:
131111
PPC_NUM_PROC: 1
132112
clang-build:
133-
needs:
134-
- pre-commit
135113
runs-on: ${{ matrix.os }}
136114
strategy:
137115
matrix:

0 commit comments

Comments
 (0)