-
Notifications
You must be signed in to change notification settings - Fork 62
/
config.yml
137 lines (126 loc) · 4.62 KB
/
config.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
version: 2.1
orbs:
python: circleci/python@0.2.1
py: nic30/python-all-in-1@0.3.0
jobs:
install-test-coverage:
resource_class: medium
docker:
- image: ubuntu:rolling
steps:
- checkout
- run:
command: |
apt update
# because of tzdata
export DEBIAN_FRONTEND=noninteractive
export TZ=America/USA
apt update
apt install -y build-essential libantlr4-runtime-dev antlr4 cmake ninja-build python3-pip python3-dev python3 python3-pip python3-venv git rubygems gcovr
python3 -m venv venv
echo "export PATH=$PATH:/usr/local/bin/" >> $BASH_ENV
echo "source $PWD/venv/bin/activate" >> $BASH_ENV
echo "export MODULE_NAME=hdlConvertor" >> $BASH_ENV
source $BASH_ENV
pip3 install build
# install lcov from source because v2.0-1 and v2.0-2 in repo are broken
git clone --depth 1 --branch v1.16 https://github.com/linux-test-project/lcov.git
cd lcov
make install
cd ..
rm -rf lcov
- run: git submodule sync
- run: git submodule update --init
- run:
command: |
gcc -v;
python --version;
cmake --version;
free;
- run: pip install jupyter
- run: gem install coveralls-lcov
- run:
name: build
command: |
# -j1 because we do not have enough RAM
# :note: it is important that Ccompile-args are separated
# :note: b_coverage=true is ignored for buildtype=release
pip3 install pybind11 meson-python Cython
pip3 install -e . --no-build-isolation \
-Csetup-args="-Dbuildtype=debug" \
-Csetup-args="-Db_coverage=true" \
-Ccompile-args="--verbose" \
-Cbuild-dir=build-dbg \
-Ccompile-args="-j1"
- py/test-and-coverage:
coverage: false # dissable python coverage, we are collecting only C++ one
- run:
name: Filter lcov outputs for scikit-build and upload it to coveralls.io
command: |
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
lcov --compat-libtool --directory . --capture --output-file coverage.info.raw # collect coverage reports
lcov --remove coverage.info.raw -o coverage.info '/usr/*' 'pybind11/*' # remove system includes and pybind11 from coverage
sed -i 's/\/root\/project\///g' coverage.info;
sed -i 's/\/root\///g' coverage.info;
coveralls-lcov coverage.info --repo-token ${COVERALLS_REPO_TOKEN};
else
echo "[INFO] Skipping the coverage upload because this is a pull request $CIRCLE_PULL_REQUEST"
fi
install-test-deploy:
resource_class: medium
docker:
- image: ubuntu:rolling
steps:
- checkout: {}
- run:
command: |
apt update
# because of tzdata
export DEBIAN_FRONTEND=noninteractive
export TZ=America/USA
apt update
# libantlr4-runtime-dev antlr4 are ommited in order that meson downloads them using wrap
apt install -y build-essential cmake ninja-build python3-pip python3-dev python3 python3-pip python3-venv git lcov gcovr rubygems
python3 -m venv venv
echo "source $PWD/venv/bin/activate" >> $BASH_ENV
echo "export MODULE_NAME=hdlConvertor" >> $BASH_ENV
source $BASH_ENV
pip3 install build
- run: git submodule sync
- run: git submodule update --init
# - python/load-cache
- run:
command: |
gcc -v;
python --version;
cmake --version;
free;
- run: pip install jupyter
- run: gem install coveralls-lcov
- run:
name: build
command: |
python3 -m build -Ccompile-args="--verbose" -Ccompile-args="-j1" . # -j1 because we do not have enough RAM
pip3 install dist/*.whl
rm -rf $MODULE_NAME
- py/test-and-coverage:
coverage: false
- py/deploy-pypi-on-tag:
bin: false
build: true
src: false
workflows:
main:
jobs:
- install-test-coverage:
filters:
tags:
only: /.*/
- install-test-deploy:
requires:
- install-test-coverage
context:
- pypi
filters:
tags:
only: /.*/