mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-05 03:28:09 +00:00
* ci: unify dependency management + hatch scripts * ci: migrate readme sync * build: migrate snippets * ci: pin hatch * ci: make Python version more explicit + quote * ci: add scripts with parameters to hatch --------- Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
78 lines
1.9 KiB
YAML
78 lines
1.9 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"
|
|
HATCH_VERSION: "1.9.3"
|
|
|
|
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@v42
|
|
with:
|
|
files: |
|
|
**/*.py
|
|
files_ignore: |
|
|
test/**
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "${{ env.PYTHON_VERSION }}"
|
|
|
|
- name: Install Hatch
|
|
run: pip install hatch==${{ env.HATCH_VERSION }}
|
|
|
|
- name: Mypy
|
|
if: steps.files.outputs.any_changed == 'true'
|
|
run: |
|
|
mkdir .mypy_cache
|
|
hatch run test:types ${{ 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@v42
|
|
with:
|
|
files: |
|
|
haystack/**/*.py
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "${{ env.PYTHON_VERSION }}"
|
|
|
|
- name: Install Hatch
|
|
run: pip install hatch==${{ env.HATCH_VERSION }}
|
|
|
|
- name: Pylint
|
|
if: steps.files.outputs.any_changed == 'true'
|
|
run: |
|
|
hatch run test:lint ${{ steps.files.outputs.all_changed_files }}
|