| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| name: Analyze using pre-commit hooks |
| |
| on: |
| push: |
| branches: [main] |
| pull_request: |
| branches: [main] |
| |
| permissions: |
| contents: read |
| |
| env: |
| UV_VERSION: '0.7.12' |
| |
| jobs: |
| analyze: |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: |
| - '3.13' |
| steps: |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| with: |
| persist-credentials: false |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 |
| with: |
| python-version: ${{ matrix.python-version }} |
| - name: Install uv |
| uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 |
| with: |
| version: ${{ env.UV_VERSION }} |
| |
| - name: Install dependencies |
| run: uv sync --dev |
| |
| - name: Cache pre-commit data |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| with: |
| path: ~/.cache/pre-commit |
| key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} |
| |
| - name: Run pre-commit |
| run: | |
| uv run pre-commit run --show-diff-on-failure --color=always --all-files |