From 1df234cdf42d6674214cde9c43e3c6b1544196d2 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Mon, 30 Jun 2025 17:51:38 +0200 Subject: [PATCH] [CI] Fix 'pre-commit' job influence on the rest of the pre-commit pipeline --- .github/workflows/pre-commit.yml | 23 +++++++++++++++++++++++ .github/workflows/ubuntu.yml | 22 ---------------------- 2 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..1b4b6abe2 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,23 @@ +name: Pre-commit checks + +on: + pull_request: + +jobs: + pre-commit: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Setup environment + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y \ + gcc-14 g++-14 ninja-build python3-pip clang-format-16 + python3 -m pip install -r requirements.txt + - name: Run pre-commit checks + run: | + git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} + pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2bb30f207..c0ba92605 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -2,27 +2,7 @@ on: workflow_call: jobs: - pre-commit: - runs-on: ubuntu-24.04 - if: github.event_name != 'push' - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - name: Setup environment - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends -y \ - gcc-14 g++-14 ninja-build python3-pip clang-format-16 - python3 -m pip install -r requirements.txt - - name: Run pre-commit checks - run: | - git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} - pre-commit run --from-ref ${{ github.base_ref }} --to-ref HEAD gcc-build: - needs: - - pre-commit runs-on: ${{ matrix.os }} strategy: matrix: @@ -130,8 +110,6 @@ jobs: env: PPC_NUM_PROC: 1 clang-build: - needs: - - pre-commit runs-on: ${{ matrix.os }} strategy: matrix: