haystack/.github/workflows/linting.yml
dependabot[bot] c73e6dd248
chore(deps): bump tj-actions/changed-files from 40 to 41 (#6641)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 40 to 41.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v40...v41)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-27 08:49:45 +01:00

80 lines
2.1 KiB
YAML

# If you change this name also do it in linting-skipper.yml and ci_metrics.yml
name: Linting
on:
pull_request:
paths:
- "haystack/**/*.py"
- "test/**/*.py"
- "e2e/**/*.py"
- "pyproject.toml"
- "!haystack/core/**/*.py"
env:
PYTHON_VERSION: "3.8"
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# With the default value of 1, there are corner cases where tj-actions/changed-files
# fails with a `no merge base` error
fetch-depth: 0
- name: Get changed files
id: files
uses: tj-actions/changed-files@v41
with:
files: |
**/*.py
files_ignore: |
test/**
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Haystack
run: pip install .[dev]
- name: Install the dependencies needed for tests
run: pip install -r test/test_requirements.txt
- name: Mypy
if: steps.files.outputs.any_changed == 'true'
run: |
mkdir .mypy_cache
mypy --install-types --non-interactive --cache-dir=.mypy_cache/ ${{ steps.files.outputs.all_changed_files }}
pylint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# With the default value of 1, there are corner cases where tj-actions/changed-files
# fails with a `no merge base` error
fetch-depth: 0
- name: Get changed files
id: files
uses: tj-actions/changed-files@v41
with:
files: |
haystack/**/*.py
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Haystack and the dependencies needed for tests
run: pip install -r test/test_requirements.txt
- name: Pylint
if: steps.files.outputs.any_changed == 'true'
run: |
pylint -ry -j 0 ${{ steps.files.outputs.all_changed_files }}