-
Notifications
You must be signed in to change notification settings - Fork 237
173 lines (163 loc) · 6.04 KB
/
cd.yml
File metadata and controls
173 lines (163 loc) · 6.04 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CD
on:
push:
branches:
- main
jobs:
prep-testbed:
if: |
!startsWith(github.event.head_commit.message, 'chore') &&
!startsWith(github.event.head_commit.message, 'build: hotfix') &&
!endsWith(github.event.head_commit.message, 'reformatted by jina-dev-bot')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.5.0
- id: set-matrix
run: |
sudo apt-get install jq
export value=$(bash scripts/get-all-test-paths.sh)
echo "matrix=$value" >> $GITHUB_OUTPUT
export value=$(bash scripts/get-all-oldproto-test-paths.sh)
echo "matrix-oldproto=$value" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
matrix-oldproto: ${{ steps.set-matrix.outputs.matrix-oldproto }}
docarray-test:
needs: prep-testbed
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]
test-path: ${{fromJson(needs.prep-testbed.outputs.matrix)}}
steps:
- uses: actions/checkout@v2.5.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Prepare enviroment
run: |
python -m pip install --upgrade pip
python -m pip install wheel
# pip does not properly resolve dependency versions with syntax pip install --no-cache-dir ".[test,full]"
pip install --no-cache-dir ".[test]"
pip install --no-cache-dir ".[qdrant]"
pip install --no-cache-dir ".[annlite]"
pip install --no-cache-dir ".[weaviate]"
pip install --no-cache-dir ".[elasticsearch]"
pip install --no-cache-dir ".[redis]"
pip install --no-cache-dir ".[full]"
sudo apt-get install libsndfile1
- name: Test
id: test
run: |
pytest --suppress-no-test-exit-code --cov=docarray --cov-report=xml \
-v -s -m "not gpu" ${{ matrix.test-path }}
echo "codecov_flag=docarray" >> $GITHUB_OUTPUT
timeout-minutes: 60
env:
JINA_AUTH_TOKEN: "${{ secrets.JINA_AUTH_TOKEN }}"
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v3.1.1
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
docarray-oldproto-test:
needs: prep-testbed
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]
test-path: ${{fromJson(needs.prep-testbed.outputs.matrix-oldproto)}}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Prepare enviroment
run: |
python -m pip install --upgrade pip
python -m pip install wheel
# pip does not properly resolve dependency versions with syntax pip install --no-cache-dir ".[test,full]"
pip install --no-cache-dir ".[test]"
pip install --no-cache-dir ".[qdrant]"
pip install --no-cache-dir ".[annlite]"
pip install --no-cache-dir ".[weaviate]"
pip install --no-cache-dir ".[elasticsearch]"
pip install --no-cache-dir ".[redis]"
pip install --no-cache-dir ".[full]"
pip install --no-cache-dir "protobuf<3.20.0"
sudo apt-get install libsndfile1
- name: Test
id: test
run: |
pytest --suppress-no-test-exit-code --cov=docarray --cov-report=xml \
-v -s -m "not gpu" ${{ matrix.test-path }}
echo "::set-output name=codecov_flag::docarray"
timeout-minutes: 60
env:
JINA_AUTH_TOKEN: "${{ secrets.JINA_AUTH_TOKEN }}"
- name: Check codecov file
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage from test to Codecov
uses: codecov/codecov-action@v2
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
with:
file: coverage.xml
flags: ${{ steps.test.outputs.codecov_flag }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
prerelease:
needs: [docarray-test, docarray-oldproto-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.5.0
with:
fetch-depth: 100
- name: Pre-release (.devN)
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
pip install twine wheel
./scripts/release.sh
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
JINA_SLACK_WEBHOOK: ${{ secrets.JINA_SLACK_WEBHOOK }}
check-readme-modification:
runs-on: ubuntu-latest
outputs:
readme_changed: ${{ steps.step_output.outputs.readme_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v34
with:
files: |
README.md
- name: Check if README is modified
id: step_output
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
echo "readme_changed=true" >> $GITHUB_OUTPUT
publish-docarray-org:
needs: check-readme-modification
if: needs.check-readme-modification.outputs.readme_changed == 'true'
uses: ./.github/workflows/publish-docarray-org.yml
secrets: inherit