@@ -2,17 +2,15 @@ name: CI
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - main
5
+ branches : [main]
7
6
pull_request :
8
7
schedule :
9
8
- cron : " 0 0 * * 1/2"
10
9
11
10
env :
12
- BENTOML_DO_NOT_TRACK : True
13
11
LINES : 120
14
12
COLUMNS : 120
15
- PYTEST_PLUGINS : bentoml.testing.pytest.plugin
13
+ BENTOML_DO_NOT_TRACK : True
16
14
17
15
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
18
16
defaults :
26
24
related : ${{ steps.filter.outputs.related }}
27
25
bentoml : ${{ steps.filter.outputs.bentoml }}
28
26
docs : ${{ steps.filter.outputs.docs }}
27
+ protos : ${{ steps.filter.outputs.protos }}
29
28
steps :
30
29
- uses : actions/checkout@v3
31
30
- uses : dorny/paths-filter@v2
37
36
- .github/workflows/ci.yml
38
37
- codecov.yml
39
38
- pyproject.toml
40
- - scripts/ci/config.yml
41
- - scripts/ci/run_tests.sh
42
39
- requirements/tests-requirements.txt
43
40
protos: &protos
44
41
- "src/bentoml/grpc/**/*.proto"
@@ -100,14 +97,22 @@ jobs:
100
97
pip install -r requirements/dev-requirements.txt
101
98
102
99
- name : Format check
103
- run : make ci-format
100
+ run : |
101
+ black --check src examples tests
102
+ black --check --pyi typings
103
+ isort --check .
104
104
- name : Lint check
105
- run : make ci-lint
105
+ run : |
106
+ git fetch origin "$GITHUB_BASE_REF"
107
+ git diff --name-only --diff-filter=d "origin/$GITHUB_BASE_REF" -z -- '*.py' | xargs -0 --no-run-if-empty pylint --rcfile pyproject.toml --fail-under 9.0 --exit-zero
106
108
- name : Type check
107
- run : make ci-pyright
109
+ run : |
110
+ git fetch origin "$GITHUB_BASE_REF"
111
+ git diff --name-only --diff-filter=d "origin/$GITHUB_BASE_REF" -z -- '*.py[i]' | xargs -0 --no-run-if-empty pyright
108
112
- name : Proto check
109
113
if : ${{ (github.event_name == 'pull_request' && needs.diff.outputs.protos == 'true') || github.event_name == 'push' }}
110
- run : buf lint --config "src/bentoml/grpc/buf.yaml" --error-format msvs src
114
+ run : |
115
+ buf lint --config "src/bentoml/grpc/buf.yaml" --error-format msvs src
111
116
112
117
documentation_spelling_check :
113
118
runs-on : ubuntu-latest
@@ -193,23 +198,21 @@ jobs:
193
198
194
199
- name : Run unit tests
195
200
run : |
196
- OPTS=(--cov-config pyproject.toml --cov-report=xml:unit.xml -vvv )
201
+ OPTS=(--cov-config pyproject.toml --cov=src/bentoml --cov-append )
197
202
if [ "${{ matrix.os }}" != 'windows-latest' ]; then
198
203
# we will use pytest-xdist to improve tests run-time.
199
204
OPTS=(${OPTS[@]} --dist loadfile -n auto --run-grpc-tests)
200
205
fi
201
206
# Now run the unit tests
202
- python -m pytest tests/unit "${OPTS[@]}"
207
+ coverage run -m pytest tests/unit "${OPTS[@]}"
208
+
209
+ - name : Generage coverage
210
+ run : coverage xml
203
211
204
212
- name : Upload test coverage to Codecov
205
213
uses : codecov/codecov-action@v3
206
214
with :
207
- name : codecov-${{ matrix.os }}-python${{ matrix.python-version }}
208
- fail_ci_if_error : true
209
- flags : unit-tests
210
- directory : ./
211
- files : ./unit.xml
212
- verbose : true
215
+ files : coverage.xml
213
216
token : ${{ secrets.CODECOV_TOKEN }}
214
217
215
218
bento_server_e2e_tests :
@@ -278,17 +281,17 @@ jobs:
278
281
fi
279
282
280
283
- name : Run ${{ matrix.server_type }} tests and generate coverage report
281
- run : ./scripts/ci/run_tests.sh ${{ matrix.server_type }}_server --verbose
284
+ run : |
285
+ OPTS=(--cov-config pyproject.toml --cov=src/bentoml --cov-append)
286
+ coverage run -m pytest tests/e2e/bento_server_${{ matrix.server_type }} "${OPTS[@]}"
287
+
288
+ - name : Generage coverage
289
+ run : coverage xml
282
290
283
291
- name : Upload test coverage to Codecov
284
292
uses : codecov/codecov-action@v3
285
293
with :
286
- flags : e2e-tests-${{ matrix.server_type }}
287
- name : codecov-${{ matrix.os }}-python${{ matrix.python-version }}-e2e
288
- fail_ci_if_error : true
289
- directory : ./
290
- files : ./tests/e2e/bento_server_${{ matrix.server_type }}/${{ matrix.server_type }}_server.xml
291
- verbose : true
294
+ files : coverage.xml
292
295
token : ${{ secrets.CODECOV_TOKEN }}
293
296
294
297
concurrency :
0 commit comments