-
Notifications
You must be signed in to change notification settings - Fork 19
132 lines (127 loc) · 4.07 KB
/
main.yaml
File metadata and controls
132 lines (127 loc) · 4.07 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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@v5
- uses: actions/setup-python@v6
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.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
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@v5
with:
name: test-results-${{ matrix.version }}
path: test-report-${{ matrix.version }}.html
get-latest-weaviate-version:
runs-on: ubuntu-latest
needs: [unit-tests]
name: Get latest Weaviate version
outputs:
LATEST_WEAVIATE_VERSION: ${{ steps.latest-version.outputs.latest_weaviate_version }}
steps:
- name: Retrieve latest Weaviate version
id: latest-version
uses: weaviate/github-common-actions/.github/actions/get-latest-weaviate-version@main
integration-tests:
needs: [unit-tests, get-latest-weaviate-version]
env:
WEAVIATE_VERSION: ${{ needs.get-latest-weaviate-version.outputs.LATEST_WEAVIATE_VERSION }}
MODULES: "text2vec-transformers-model2vec,text2vec-contextionary"
name: Run Integration Tests
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
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
dynamic-users: true
- name: Run integration tests with pytest
run: |
pip install pytest-html
pytest test/integration/test_integration.py --html=test-report-${{ matrix.version }}.html --self-contained-html
integration-auth-tests:
needs: [unit-tests, get-latest-weaviate-version]
env:
WEAVIATE_VERSION: ${{ needs.get-latest-weaviate-version.outputs.LATEST_WEAVIATE_VERSION }}
MODULES: "text2vec-transformers-model2vec,text2vec-contextionary"
name: Run Integration Tests Auth
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
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
rbac: true
dynamic-users: true
- name: Create config directory
run: mkdir -p ~/.config/weaviate
- name: Create config file
run: |
echo '{
"host": "localhost",
"http_port": "8080",
"grpc_port": "50051",
"auth": {
"type": "api_key",
"api_key": "admin-key"
}
}' > ~/.config/weaviate/config.json
- name: Run integration auth tests with pytest
run: |
pip install pytest-html
pytest test/integration/test_auth_integration.py --html=test-auth-report-${{ matrix.version }}.html --self-contained-html