mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-07 04:27:15 +00:00
* move commandline args to global conftest * correct test exclude paths * Update Documentation & Code Style * exclude test_generator_pipeline_with_translator from windows ci * exclude further oom tests * enable log_cli Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
106 lines
4.0 KiB
YAML
106 lines
4.0 KiB
YAML
name: Windows CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ master ]
|
|
# pull_request:
|
|
# branches: [ master ]
|
|
|
|
jobs:
|
|
type-check:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Test with mypy
|
|
run: |
|
|
pip install mypy==0.910 types-Markdown types-requests types-PyYAML pydantic
|
|
mypy haystack
|
|
|
|
build-cache:
|
|
needs: type-check
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Cache
|
|
id: cache-python-env
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.pythonLocation }}
|
|
# The cache currently misses at every change in the Python files to ensure
|
|
# that the code changes to Haystack are not being cached along with the dependencies.
|
|
# TODO for the tests refactoring: We could speed up the process by caching only
|
|
# the dependencies and installing Haystack again separately for each test runner.
|
|
key: windows-${{ hashFiles('**/*.py') }}-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github') }}
|
|
|
|
- name: Install Pytorch on windows
|
|
run: |
|
|
pip install torch==1.8.1+cpu -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
|
|
|
|
- name: Install dependencies
|
|
if: steps.cache-python-env.outputs.cache-hit != 'true'
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install --upgrade --upgrade-strategy eager .[test]
|
|
pip install --upgrade --upgrade-strategy eager rest_api/
|
|
pip install --upgrade --upgrade-strategy eager ui/
|
|
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html
|
|
|
|
prepare-build:
|
|
needs: build-cache
|
|
# With Windows it gives error, also this step only listing test files only
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- id: set-matrix
|
|
run: |
|
|
echo "::set-output name=matrix::$(find $(find . -type d -name test -not -path "./*env*/*") -type f -name test_*.py | jq -SR . | jq -cs .)"
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
build:
|
|
needs: prepare-build
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
test-path: ${{fromJson(needs.prepare-build.outputs.matrix)}}
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python 3.7
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.pythonLocation }}
|
|
key: windows-${{ hashFiles('**/*.py') }}-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github') }}
|
|
|
|
# Windows runner can't run Linux containers. Refer https://github.com/actions/virtual-environments/issues/1143
|
|
- name: Set up Windows test env
|
|
run: |
|
|
choco install xpdf-utils
|
|
choco install openjdk11
|
|
refreshenv
|
|
choco install tesseract --pre
|
|
choco install elasticsearch --version=7.9.2
|
|
refreshenv
|
|
Get-Service elasticsearch-service-x64 | Start-Service
|
|
|
|
# We have to remove files if not test going to run from it
|
|
# As on windows we are going to disable quite a few tests these, hence these files will throw error refer https://github.com/pytest-dev/pytest/issues/812
|
|
# Removing test_ray, test_utils, test_preprocessor, test_knowledge_graph and test_connector
|
|
- name: Run tests
|
|
if: ${{ !contains(fromJSON('["./test/test_ray.py", "./test/test_knowledge_graph.py", "./test/test_connector.py", "./test/test_summarizer_translation.py", "./test/test_summarizer.py"]'), matrix.test-path) }}
|
|
run: pytest --document_store_type=memory,faiss,elasticsearch -m "not tika and not graphdb" -k "not test_parsr_converter" -s ${{ matrix.test-path }}
|