From 6b24f901b7e1a647e548e21e989d9e610946d621 Mon Sep 17 00:00:00 2001 From: Sergey Morozov Date: Tue, 27 Feb 2024 13:09:22 +0300 Subject: [PATCH] [chore, git] make entire pipeline dependent on the result of the clang-format check. --- .github/workflows/build-in-base-env.yml | 9 +++++---- .github/workflows/build.yaml | 23 ++++++++--------------- .github/workflows/clang-format.yaml | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/clang-format.yaml diff --git a/.github/workflows/build-in-base-env.yml b/.github/workflows/build-in-base-env.yml index daf22bff94..04b7da3633 100644 --- a/.github/workflows/build-in-base-env.yml +++ b/.github/workflows/build-in-base-env.yml @@ -1,14 +1,15 @@ name: Build in UTBot base_env on: - pull_request: - branches: [utbot-main] - push: - branches: [utbot-main] + workflow_run: + workflows: ["Clang Format"] + types: + - completed jobs: build: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} container: image: ghcr.io/unittestbot/utbotcpp/base_env:02-02-2022 credentials: diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2e911bd10a..192af2535f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,10 +2,10 @@ name: CI on: - pull_request: - branches: [main, utbot-main] - push: - branches: [main, utbot-main] + workflow_run: + workflows: ["Clang Format"] + types: + - completed # Defaults for building KLEE env: @@ -35,6 +35,7 @@ env: jobs: Linux: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} strategy: matrix: name: [ @@ -144,6 +145,7 @@ jobs: macOS: runs-on: macos-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} env: BASE: /tmp SOLVERS: STP @@ -164,6 +166,7 @@ jobs: Docker: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout KLEE Code uses: actions/checkout@v3 @@ -174,6 +177,7 @@ jobs: Coverage: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} strategy: matrix: name: [ @@ -209,14 +213,3 @@ jobs: - name: Run tests env: ${{ matrix.env }} run: scripts/build/run-tests.sh --coverage --upload-coverage --run-docker --debug - - clang-format: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - uses: pre-commit/action@v3.0.1 - - uses: pre-commit-ci/lite-action@v1.0.2 - if: always() diff --git a/.github/workflows/clang-format.yaml b/.github/workflows/clang-format.yaml new file mode 100644 index 0000000000..12d8135906 --- /dev/null +++ b/.github/workflows/clang-format.yaml @@ -0,0 +1,20 @@ +--- +name: Clang Format + +on: + pull_request: + branches: [main, utbot-main] + push: + branches: [main, utbot-main] + +jobs: + clang-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 + - uses: pre-commit-ci/lite-action@v1.0.2 + if: always()