Skip to content

Commit 1a7e258

Browse files
authoredAug 31, 2018
Add OS X to Travis (NervanaSystems#1527)
1 parent e6dad53 commit 1a7e258

File tree

3 files changed

+48
-35
lines changed

3 files changed

+48
-35
lines changed
 

‎.ci/travis/centos/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ COPY . /root/ngraph
2626
RUN mkdir /root/ngraph/build
2727
WORKDIR /root/ngraph/build
2828

29-
RUN cmake .. -L -DNGRAPH_CPU_ENABLE=FALSE -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE -DCMAKE_INSTALL_PREFIX="~/ngraph_dist"
29+
RUN cmake .. -L -DNGRAPH_CPU_ENABLE=FALSE -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE
3030

3131
RUN make -j"$(nproc)"
3232
RUN make install

‎.ci/travis/ubuntu/Dockerfile

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
FROM ubuntu:16.04
22

3-
#buildtype argument
4-
ARG buildtype=regular
5-
63
# nGraph dependencies
74
RUN apt-get update && apt-get install -y \
85
build-essential \
@@ -28,22 +25,16 @@ RUN apt-get update && apt-get install -y \
2825
python3-dev \
2926
python-pip && \
3027
apt-get clean autoclean && apt-get autoremove -y
28+
3129
RUN pip install --upgrade pip setuptools wheel
3230
RUN pip install tox
3331

3432
# Prepare nGraph
3533
COPY . /root/ngraph
3634
RUN mkdir /root/ngraph/build
3735
WORKDIR /root/ngraph/build
38-
39-
RUN if [ "$buildtype" = "interpreter" ] ; then \
40-
cmake .. -DNGRAPH_CPU_ENABLE=FALSE -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE\
41-
-DCMAKE_INSTALL_PREFIX="~/ngraph_dist";\
42-
else \
43-
cmake .. -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE -DCMAKE_INSTALL_PREFIX="~/ngraph_dist" ;\
44-
fi
45-
46-
RUN make
36+
RUN cmake .. -DNGRAPH_CPU_ENABLE=FALSE -DNGRAPH_USE_PREBUILT_LLVM=TRUE -DNGRAPH_ONNX_IMPORT_ENABLE=TRUE -DCMAKE_INSTALL_PREFIX="~/ngraph_dist"
37+
RUN make -j"$(nproc)"
4738
RUN make install
4839

4940
# Prepare nGraph Python API

‎.travis.yml

+44-22
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,54 @@
1-
sudo: required
2-
31
language: cpp
42

5-
services:
6-
- docker
7-
83
git:
94
depth: false
105

11-
env:
12-
- TASK=cpp_test OS=ubuntu
13-
- TASK=cpp_test OS=centos
14-
- TASK=python2_test OS=ubuntu
15-
- TASK=python3_test OS=ubuntu
16-
17-
before_install:
18-
- |
19-
if [ "TASK" == "cpp_test" ]; then
20-
docker build -t test_ngraph -f .ci/travis/$OS/Dockerfile .
21-
else
22-
docker build -t test_ngraph -f .ci/travis/$OS/Dockerfile --build-arg buildtype=interpreter .
23-
fi
24-
25-
install: true
6+
matrix:
7+
include:
8+
- os: linux
9+
sudo: required
10+
services: docker
11+
env: TASK=python2_test OS=ubuntu
12+
- os: linux
13+
sudo: required
14+
services: docker
15+
env: TASK=python3_test OS=ubuntu
16+
- os: linux
17+
sudo: required
18+
services: docker
19+
env: TASK=cpp_test OS=ubuntu
20+
- os: linux
21+
sudo: required
22+
services: docker
23+
env: TASK=cpp_test OS=centos
24+
- os: osx
25+
env: TASK=cpp_test OS=osx
26+
27+
install:
28+
- |
29+
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
30+
docker build -t test_ngraph -f .ci/travis/$OS/Dockerfile .
31+
fi
32+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
33+
mkdir $TRAVIS_BUILD_DIR/build
34+
cd $TRAVIS_BUILD_DIR/build
35+
cmake .. -DNGRAPH_CPU_ENABLE=FALSE \
36+
-DNGRAPH_USE_PREBUILT_LLVM=TRUE \
37+
-DNGRAPH_ONNX_IMPORT_ENABLE=TRUE \
38+
-DCMAKE_INSTALL_PREFIX="~/ngraph_dist"
39+
make -j 2
40+
fi
2641
2742
script:
28-
- .ci/travis/run_test.sh
43+
- |
44+
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
45+
.ci/travis/run_test.sh
46+
fi
47+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
48+
cd $TRAVIS_BUILD_DIR/build
49+
make unit-test-check
50+
fi
2951
3052
branches:
3153
only:
32-
- "master"
54+
- "master"

0 commit comments

Comments
 (0)
Please sign in to comment.