Clarify corpus parameter accepts two formats (strings and dicts only) #256
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test-core: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache Python dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('tests/requirements-core.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install core dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r tests/requirements-core.txt | |
| pip install coverage | |
| - name: Run core tests with coverage | |
| run: | | |
| python -m coverage run --source=bm25s -m unittest discover tests/core | |
| COVERAGE_OUTPUT=$(python -m coverage report --omit="*/tests/*,*/numba/*") | |
| echo "$COVERAGE_OUTPUT" | |
| echo "Coverage percentage:" | |
| echo "$COVERAGE_OUTPUT" | tail -1 | awk '{print "Total Coverage: " $4}' | |
| - name: Install Numba | |
| run: | | |
| pip install "numba>=0.60.0" | |
| - name: Run numba tests | |
| run: | | |
| python -m unittest tests/numba/test_*.py | |
| test-comparison: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache Python dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('tests/requirements-comparison.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install comparison dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r tests/requirements-comparison.txt | |
| - name: Run comparison tests with dependencies | |
| run: | | |
| python -m unittest tests/comparison/test_*.py |