-
Notifications
You must be signed in to change notification settings - Fork 13
77 lines (73 loc) · 2.1 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Main
on:
push:
branches:
- main
pull_request:
jobs:
lint-and-format:
name: Run Linter and Formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -r requirements-dev.txt
- name: "Black"
run: black --check cli.py weaviate_cli test
- name: "Check release for pypi"
run: |
python -m build
python -m twine check dist/*
unit-tests:
name: Run Unit Tests
needs: [lint-and-format]
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- run: pip install -e .
- name: Run unit tests with pytest
run: |
pip install pytest-html
pytest test/unittests --html=test-report-${{ matrix.version }}.html --self-contained-html
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.version }}
path: test-report-${{ matrix.version }}.html
integration-tests:
needs: [unit-tests]
env:
WEAVIATE_VERSION: "1.27.0"
MODULES: "text2vec-transformers,text2vec-contextionary"
name: Run Integration Tests
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- run: pip install -e .
- name: Start up Weaviate cluster
uses: weaviate/weaviate-local-k8s@v2
with:
workers: 1
replicas: 1
weaviate-version: ${{ env.WEAVIATE_VERSION }}
modules: ${{ env.MODULES }}
enable-backup: true
- name: Run integration tests with pytest
run: |
pip install pytest-html
pytest test/integration/ --html=test-report-${{ matrix.version }}.html --self-contained-html