From 4fe3333f94f73351ac4d0e27bd30c7223761a12b Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Wed, 12 Jul 2023 02:20:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=F0=9F=A7=AA=20Wire=20linters=20int?= =?UTF-8?q?o=20the=20main=20CI=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes the quality workflow definition into reusable. It doesn't need to track the same triggers and conditions as the main one. Additionally, the `alls-green` check can now take into account the outcome of linting making it possible to only have one job in the branch protection. --- .../workflows/{quality.yml => reusable-quality.yml} | 11 +---------- .github/workflows/testsuite.yml | 11 +++++++++-- 2 files changed, 10 insertions(+), 12 deletions(-) rename .github/workflows/{quality.yml => reusable-quality.yml} (92%) diff --git a/.github/workflows/quality.yml b/.github/workflows/reusable-quality.yml similarity index 92% rename from .github/workflows/quality.yml rename to .github/workflows/reusable-quality.yml index 847bfd7cc..dd9f3590c 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/reusable-quality.yml @@ -4,12 +4,7 @@ name: "Quality" on: - push: - branches: - - master - - nedbat/* - pull_request: - workflow_dispatch: + workflow_call: defaults: run: @@ -21,10 +16,6 @@ env: permissions: contents: read -concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true - jobs: lint: name: "Pylint etc" diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 8f878e662..3f5e09be2 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -28,10 +28,16 @@ concurrency: cancel-in-progress: true jobs: + linters: + name: Quality + # Don't run pipeline if the branch name includes "-notests" + if: "!contains(github.ref, '-notests')" + uses: ./.github/workflows/reusable-quality.yml + tests: name: "${{ matrix.python-version }} on ${{ matrix.os }}" runs-on: "${{ matrix.os }}-latest" - # Don't run tests if the branch name includes "-notests" + # Don't run pipeline if the branch name includes "-notests" if: "!contains(github.ref, '-notests')" strategy: matrix: @@ -91,9 +97,10 @@ jobs: # https://github.com/orgs/community/discussions/33579 success: name: Tests successful - # The tests didn't run if the branch name includes "-notests" + # Don't run pipeline if the branch name includes "-notests" if: "!contains(github.ref, '-notests')" needs: + - linters - tests runs-on: ubuntu-latest steps: