diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33a5950c1483a2..701691c488c5ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,10 @@ jobs: # uses: ./.github/workflows/reusable-context.yml + lint: + name: lint + uses: ./.github/workflows/reusable-lint.yml + check-docs: name: Docs needs: build-context @@ -655,6 +659,7 @@ jobs: timeout-minutes: 5 needs: - build-context # Transitive dependency, needed to access `run-tests` value + - lint - check-docs - check-autoconf-regen - check-generated-files diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e9a4eb2b0808cb..0aec09d7d27c3e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,21 +5,10 @@ on: [push, pull_request, workflow_dispatch] permissions: contents: read -env: - FORCE_COLOR: 1 - RUFF_OUTPUT_FORMAT: github - concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: lint: - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1 + uses: ./.github/workflows/reusable-lint.yml diff --git a/.github/workflows/reusable-lint.yml b/.github/workflows/reusable-lint.yml new file mode 100644 index 00000000000000..846c0b30e440a5 --- /dev/null +++ b/.github/workflows/reusable-lint.yml @@ -0,0 +1,23 @@ +name: Reusable Lint + +on: + workflow_call: + workflow_dispatch: + +permissions: + contents: read + +env: + FORCE_COLOR: 1 + RUFF_OUTPUT_FORMAT: github + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1