This repository has been archived by the owner on Jan 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (114 loc) · 3.94 KB
/
ci.yml
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
name: CI
on:
pull_request:
jobs:
commit-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: "echo \"module.exports = {extends: ['@commitlint/config-conventional']}\" > commitlint.config.js"
- uses: wagoid/commitlint-github-action@v1
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
unit-test:
needs: commit-lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] #[macos-latest, ubuntu-latest]
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install '.[all]' --no-cache-dir
- name: Test with pytest
run: |
pytest --force-flaky --min-passes 1 --max-runs 5 --cov=jinad --cov-report=xml -v tests/unit
mv coverage.xml unit-test-coverage.xml
timeout-minutes: 30
- name: Upload coverage result from unit-test
if: ${{ matrix.python-version }} == 3.7 && ${{ matrix.os }} == ubuntu-latest
uses: actions/upload-artifact@v1
with:
name: unit-test-codecoverage
path: ./unit-test-coverage.xml
integration-test:
needs: commit-lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] #[macos-latest, ubuntu-latest]
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install '.[all]' --no-cache-dir
- name: Build jina test-pip for hubpod
run: |
docker build -f Dockerfiles/pip.Dockerfile -t jinaai/jinad:test-pip .
- name: Build pod image
run: |
docker build -f tests/integration/distributed/hub_mwu/Dockerfile tests/integration/distributed/hub_mwu -t hubpod:test
timeout-minutes: 5
- name: Test with pytest
run: |
pytest --force-flaky --min-passes 1 --max-runs 5 --cov=jinad --cov-report=xml -v tests/integration
mv coverage.xml integration-test-coverage.xml
timeout-minutes: 30
- name: Upload coverage result from integration-test
if: ${{ matrix.python-version }} == 3.7 && ${{ matrix.os }} == ubuntu-latest
uses: actions/upload-artifact@v1
with:
name: integration-test-codecoverage
path: ./integration-test-coverage.xml
codecov:
needs: [unit-test, integration-test]
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7]
steps:
- uses: actions/checkout@v2
with:
submodules: false
- name: Download coverage result from unit-test
uses: actions/download-artifact@v1
with:
name: unit-test-codecoverage
- name: Download coverage result from integration-test
uses: actions/download-artifact@v1
with:
name: integration-test-codecoverage
- name: Upload coverage from unit-test to Codecov
uses: codecov/codecov-action@v1
with:
file: unit-test-codecoverage/unit-test-coverage.xml
env_vars: OS,PYTHON
name: codecov
fail_ci_if_error: false
- name: Upload coverage from integration-test to Codecov
uses: codecov/codecov-action@v1
with:
file: integration-test-codecoverage/integration-test-coverage.xml
env_vars: OS,PYTHON
name: codecov
fail_ci_if_error: false