Add models and interfaces #77
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
name: "Static analysis & tests" | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
jobs: | |
static-analysis: | |
name: Static Analysis | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
pip install pylint | |
- name: Analysing the code with pylint | |
run: | | |
pylint $(git ls-files '*.py') | |
format-check: | |
name: Format check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
pip install black | |
- name: Check code format with Black | |
run: | | |
black --check $(git ls-files '*.py') | |
python-tests: | |
env: | |
TEST_FILES: test/test_similarity* test/test_runner* test/test_column2VecCache.py | |
name: Run Python Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
PYTHONPATH="./similarity:./similarityRunner:$PYTHONPATH" \ | |
coverage run --source='similarity,column2Vec,similarityRunner' -m \ | |
pytest $TEST_FILES | |
- name: Show coverage | |
run: coverage report -m --omit=".*.ipynb,similarityRunner/UI/*,*[U|u]ser*,similarityRunner/runner.py" | |
- name: Create coverage file | |
if: github.event_name == 'pull_request' | |
run: coverage xml --omit=".*.ipynb,similarityRunner/UI/*,*[U|u]ser*,similarityRunner/runner.py" | |
- name: Get Cover | |
if: github.event_name == 'pull_request' | |
uses: orgoro/[email protected] | |
with: | |
coverageFile: coverage.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
thresholdAll: 0.7 | |
thresholdNew: 0.8 | |
- uses: actions/upload-artifact@v4 | |
if: github.event_name == 'pull_request' | |
with: | |
name: coverage | |
path: coverage.xml | |
retention-days: 1 |