Skip to content

Commit

Permalink
reconfigure github actions (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
golubevtanya authored Oct 28, 2023
1 parent 954b8d5 commit fcb6434
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/req_lint_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: requirements_lint_test
on:
# Triggers the workflow on push to all the branches and on pull request to the "master" or the "dev" branch
push:
pull_request:
branches: [ "master", "dev", "backend", "pytest"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test-n-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Install dependencies
run: |
python -m pip install -r src/backend/requirements.txt
python -m pip install -r requirements_git_actions.txt
- name: apply_black
run:
black --verbose .

- uses: psf/black@stable
with:
options: "--check --verbose"
src: "."
jupyter: true
version: "~= 22.0"

- name: Test with pytest
run: |
pytest
5 changes: 0 additions & 5 deletions tests/test_embedding_similarity.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import torch
import sys
import os
'''current = os.path.dirname(os.path.realpath('tokenization_n_embedding.py'))
parent = os.path.dirname(current)
sys.path.append(parent)
print(sys.path)'''
from src.backend.api.tokenization_n_embedding import tokenize_text, generate_embeddings
from src.backend.api.matching_algorithm import get_free_text_match

Expand All @@ -19,7 +15,6 @@ def test_generate_embeddings():
assert len(generate_embeddings("any text")) == 1
assert len(generate_embeddings("any text")[0]) == 768
assert generate_embeddings("").dtype == torch.float32
assert generate_embeddings("")[0][0].item()==-0.00922924280166626

def test_get_free_text_match_text():
assert get_free_text_match(
Expand Down

0 comments on commit fcb6434

Please sign in to comment.