-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2350 from tomaarsen/tests/simplify_and_ci
`[ci]` Simplify tests, add CI, patch `paraphrase_mining_embeddings`
- Loading branch information
Showing
6 changed files
with
178 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Unit tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- v*-release | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
test_sampling: | ||
name: Run unit tests | ||
strategy: | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | ||
os: [ubuntu-latest, windows-latest] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Try to load cached dependencies | ||
uses: actions/cache@v3 | ||
id: restore-cache | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: python-dependencies-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}-${{ env.pythonLocation }} | ||
|
||
- name: Install external dependencies on cache miss | ||
run: | | ||
python -m pip install --no-cache-dir --upgrade pip | ||
python -m pip install --no-cache-dir -r requirements.txt | ||
python -m pip install --no-cache-dir pytest | ||
if: steps.restore-cache.outputs.cache-hit != 'true' | ||
|
||
- name: Install the checked-out sentence-transformers | ||
run: python -m pip install . | ||
|
||
- name: Run unit tests | ||
shell: bash | ||
run: | | ||
pytest -sv tests/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[pytest] | ||
testpaths = | ||
tests | ||
addopts = --strict-markers -m "not slow" | ||
markers = | ||
slow: marks tests as slow |
This file contains 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
This file contains 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
This file contains 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
This file contains 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