mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-09 05:37:25 +00:00
* Add ParsrConverter * Fix typing error + add Parsr to Linux CI * Fix valid_language for all converters + fix context generation for ParsrConverter * Remove ParsrConverter test from WindowsCI * Add latest docstring and tutorial changes Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
100 lines
3.8 KiB
YAML
100 lines
3.8 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
|
|
- run: echo "date=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV
|
|
- name: Cache
|
|
id: cache-python-env
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.pythonLocation }}
|
|
key: windows-${{ env.pythonLocation }}-${{ env.date }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
|
|
- 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 -r requirements-dev.txt -e .
|
|
pip install --upgrade --upgrade-strategy eager -r ui/requirements.txt -e .
|
|
pip install --upgrade --upgrade-strategy eager -f https://download.pytorch.org/whl/torch_stable.html -r requirements.txt -e .
|
|
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::$(cd test && ls -d test_*.py | jq -R . | 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
|
|
- run: echo "date=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV
|
|
- name: Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.pythonLocation }}
|
|
key: windows-${{ env.pythonLocation }}-${{ env.date }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
|
|
|
|
# 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_ray.py", "test_knowledge_graph.py", "test_connector.py", "test_summarizer_translation.py"]'), matrix.test-path) }}
|
|
run: cd test && pytest --document_store_type=memory,faiss,elasticsearch -m "not tika and not graphdb" -k "not test_parsr_converter" -s ${{ matrix.test-path }}
|