Fetch all reviews in `.github/workflows/require-core-maintainer-appro… #144
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
push: | |
branches: | |
- master | |
- branch-[0-9]+.[0-9]+ | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash --noprofile --norc -exo pipefail {0} | |
env: | |
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/untracked | |
- uses: ./.github/actions/setup-python | |
id: setup-python | |
- name: Add problem matchers | |
run: | | |
echo "::add-matcher::.github/workflows/matchers/clint.json" | |
echo "::add-matcher::.github/workflows/matchers/format.json" | |
echo "::add-matcher::.github/workflows/matchers/ruff.json" | |
- uses: ./.github/actions/cache-pip | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install -r requirements/lint-requirements.txt | |
dev/install-taplo.sh | |
- uses: ./.github/actions/show-versions | |
- uses: ./.github/actions/pipdeptree | |
- name: Install pre-commit hooks | |
run: | | |
source .venv/bin/activate | |
pre-commit install | |
- name: Run pre-commit | |
id: pre-commit | |
env: | |
IS_MAINTAINER: ${{ contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association )}} | |
NO_FIX: "true" | |
run: | | |
source .venv/bin/activate | |
pre-commit run --all-files |