name: Linux CI on: workflow_dispatch: push: branches: [ master ] pull_request: branches: [ master ] jobs: type-check: runs-on: ubuntu-20.04 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: ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: 3.7 - run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Cache id: cache-python-env uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} key: linux-${{ env.pythonLocation }}-${{ env.date }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }} - 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 requirements.txt -e . pip install --upgrade --upgrade-strategy eager -r ui/requirements.txt -e . pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html prepare-build: needs: build-cache 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: ubuntu-20.04 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')" >> $GITHUB_ENV - name: Cache uses: actions/cache@v2 with: path: ${{ env.pythonLocation }} key: linux-${{ env.pythonLocation }}-${{ env.date }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }} - name: Run Elasticsearch run: docker run -d -p 9200:9200 -e "discovery.type=single-node" -e "ES_JAVA_OPTS=-Xms128m -Xmx128m" elasticsearch:7.9.2 - name: Run Milvus run: docker run -d -p 19530:19530 -p 19121:19121 milvusdb/milvus:1.1.0-cpu-d050721-5e559c - name: Run Weaviate run: docker run -d -p 8080:8080 --name haystack_test_weaviate --env AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED='true' --env PERSISTENCE_DATA_PATH='/var/lib/weaviate' semitechnologies/weaviate:1.7.2 - name: Run GraphDB run: docker run -d -p 7200:7200 --name haystack_test_graphdb deepset/graphdb-free:9.4.1-adoptopenjdk11 - name: Run Apache Tika run: docker run -d -p 9998:9998 -e "TIKA_CHILD_JAVA_OPTS=-JXms128m" -e "TIKA_CHILD_JAVA_OPTS=-JXmx128m" apache/tika:1.24.1 - name: Run Parsr run: docker run -d -p 3001:3001 axarev/parsr:v1.2.2 # - name: Run Ray # run: RAY_DISABLE_MEMORY_MONITOR=1 ray start --head - name: Install pdftotext run: wget --no-check-certificate https://dl.xpdfreader.com/xpdf-tools-linux-4.03.tar.gz && tar -xvf xpdf-tools-linux-4.03.tar.gz && sudo cp xpdf-tools-linux-4.03/bin64/pdftotext /usr/local/bin - name: Install tesseract run: sudo apt-get install tesseract-ocr libtesseract-dev poppler-utils - name: Run tests run: cd test && pytest -s ${{ matrix.test-path }}