-
Notifications
You must be signed in to change notification settings - Fork 48
/
.travis.yml
67 lines (55 loc) · 2.36 KB
/
.travis.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
#=========================================================================
# TravisCI Setup
#=========================================================================
#------------------------------------------------------------------------
# language and build matrix
#------------------------------------------------------------------------
dist: xenial
language: python
# Use pypy3.6-7.0.0+ to have 1.12.0 version of CFFI which has `dlclose`
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
env:
- CONFIG=""
#------------------------------------------------------------------------
# install dependencies
#------------------------------------------------------------------------
install:
# Check if we are using pypy
- export NOT_USING_PYPY=$(python -V | grep -q "PyPy"; echo $?)
# Install packages
- sudo apt-get install -y graphviz
# Install verilator
- wget https://github.com/pymtl/verilator-travisci-cache/raw/master/verilator-travis-4.036.tar.gz
- tar -C ${HOME} -xzf verilator-travis-4.036.tar.gz
- export VERILATOR_ROOT=${HOME}/verilator
- export PATH=${VERILATOR_ROOT}/bin:${PATH}
- export PYMTL_VERILATOR_INCLUDE_DIR=${VERILATOR_ROOT}/share/verilator/include
- verilator --version
# Install Python requirements
- pip install --upgrade pip setuptools twine `if [ $NOT_USING_PYPY -eq 1 ]; then echo ""; else echo "--requirement requirements/pypy-constraints.txt"; fi`
- pip install --upgrade --requirement requirements/`if [ $NOT_USING_PYPY -eq 1 ]; then echo "CI.txt"; else echo "CI-pypy.txt"; fi`
- pip install .
- pip list
#------------------------------------------------------------------------
# test runner
#------------------------------------------------------------------------
# We only report code coverage for non-PyPy runs
script:
- autoflake --recursive --in-place --remove-duplicate-keys .
- pyupgrade --py3-only --keep-percent-format $(find . -name '*.py')
- isort ./pymtl3
- flake8 --select=F --ignore=F401,F405,F403,F811,F821,F841
- git diff --exit-code
- mkdir -p build
- cd build
- pytest `if [ $NOT_USING_PYPY -eq 1 ]; then echo "--cov-report xml --cov=pymtl3"; else echo ""; fi` .. $CONFIG --hypothesis-profile CI
#-------------------------------------------------------------------------
# after success
#-------------------------------------------------------------------------
after_success:
- if [ $NOT_USING_PYPY -eq 1 ]; then codecov; fi