mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-01 09:37:36 +00:00
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: Black
|
|
|
|
on:
|
|
workflow_dispatch: # Activate this workflow manually
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
# release branches have the form v1.9.x
|
|
- 'v[0-9].*[0-9].x'
|
|
|
|
jobs:
|
|
|
|
black:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Python
|
|
uses: ./.github/actions/python_cache/
|
|
|
|
- name: Install Haystack
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install .[dev]
|
|
|
|
- name: Check status
|
|
run: |
|
|
if ! black . --check; then
|
|
git status
|
|
echo "###################################################################################################"
|
|
echo "# "
|
|
echo "# CHECK FAILED! Black found issues with your code formatting."
|
|
echo "# "
|
|
echo "# Either:"
|
|
echo "# 1. Run Black locally before committing:"
|
|
echo "# "
|
|
echo "# pip install black==22.6.0"
|
|
echo "# black ."
|
|
echo "# "
|
|
echo "# 2. Install the pre-commit hook:"
|
|
echo "# "
|
|
echo "# pre-commit install --hook-type pre-push"
|
|
echo "# "
|
|
echo "# 3. See https://github.com/deepset-ai/haystack/blob/main/CONTRIBUTING.md for help."
|
|
echo "# "
|
|
echo "# If you have further problems, please open an issue: https://github.com/deepset-ai/haystack/issues"
|
|
echo "# "
|
|
echo "##################################################################################################"
|
|
exit 1
|
|
fi
|