-
Notifications
You must be signed in to change notification settings - Fork 32
71 lines (63 loc) · 1.98 KB
/
run_test.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
name: Build
on:
push:
branches: [ master ]
paths-ignore:
- 'frontend/**'
pull_request:
branches: [ master ]
paths-ignore:
- 'frontend/**'
jobs:
test:
runs-on: ubuntu-18.04
services:
mongodb:
image: mongo
ports:
- 27017:27017
env:
MONGO_HOST: localhost
MONGO_PORT: 27017
PYTHONPATH: .
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Configure MongoDB
run: mongo modelci --eval 'db.createUser({user:"modelci",pwd:"modelci@2020",roles:["readWrite"]});'
# refer to https://github.com/dmlc/gluon-nlp/blob/master/.github/workflows/unittests.yml
- name: Install tvm
run: |
sudo apt-get update
sudo apt-get install -y gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev libopenblas-dev ninja-build
git clone https://github.com/apache/incubator-tvm tvm --recursive
cd tvm
mkdir -p build
cp cmake/config.cmake build
echo set\(USE_LLVM ON\) >> build/config.cmake
echo set\(USE_GRAPH_RUNTIME ON\) >> build/config.cmake
echo set\(USE_BLAS openblas\) >> build/config.cmake
cd build
cmake .. -G Ninja
ninja
cd ../python
python -m pip install -U -e .
cd ..
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install flake8 pytest
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python modelci/app/__init__.py
python -m pytest tests/