forked from htm-community/htm.core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
152 lines (147 loc) · 5.21 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# CircleCI Build Config
# https://circleci.com/docs/2.0/configuration-reference/#section=configuration
#
# Targets:
# - Max OS/X
# - ARM64
version: 2
jobs:
# job: Mac OS/X raw ("build-and-test")
build-and-test:
macos:
xcode: '10.1.0'
working_directory: ~/numenta/htm.core
parallelism: 1
environment:
XCODE_SCHEME: htm
XCODE_WORKSPACE: htm
ARCHFLAGS: -arch x86_64
steps:
# Machine Setup
- run:
name: Make sure to use OS X in CircleCI Web UI
command: |
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "Must set option to use OS X in CircleCI Web UI" && exit 1;
fi
- run: sudo systemsetup -settimezone 'GMT'
- run:
name: Restoring system python
command: |
echo 'python version: ' && python --version
echo 'pip version: ' && python -m pip --version
echo 'python version: ' && python --version
- run:
name: Installing cmake
command: brew install cmake || brew install cmake
- checkout
# Dependencies
# Restore the dependency cache
# - restore_cache:
# keys:
# # This branch if available
# - v1-dep-{{ .Branch }}-
# # Default branch if not
# - v1-dep-master-
# # Any branch if there are none on the default branch - this should be
# # unnecessary if you have your default branch configured correctly
# - v1-dep-
- run:
name: Installing python dependencies
command: |
python -m pip install --user --upgrade pip setuptools setuptools-scm
python -m pip install --no-cache-dir --user -r bindings/py/packaging/requirements.txt --verbose || exit
# Save dependency cache
# - save_cache:
# key: v1-dep-{{ .Branch }}-{{ epoch }}
# paths:
# # This is a broad list of cache paths to include many possible
# # development environments.
# - vendor/bundle
# - ~/virtualenvs
# - ~/.m2
# - ~/.ivy2
# - ~/.bundle
# - ~/.go_workspace
# - ~/.gradle
# - ~/.cache/bower
# Build
- run:
name: Compiling
environment:
VERBOSE: 1
command: |
mkdir -p build/scripts
cd build/scripts
cmake ../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../Release
make -j2 | grep -v -F '\\-\\- Installing:'
make install 2>&1 | grep -v -F 'Installing:'
# Test
- run:
name: Running C++ Tests
command: |
mkdir -p $CIRCLE_WORKING_DIRECTORY/tests/cpp
cd ./build/Release/bin
./unit_tests --gtest_output=xml:$CIRCLE_WORKING_DIRECTORY/tests/cpp/unit_tests_report.xml
- run:
name: Install Python extension
command: python setup.py install --user --prefix=
- run:
name: Running python tests
command: python setup.py test
- store_test_results:
path: tests
- store_artifacts:
path: dist/*.whl
##- persist_to_workspace:
## root: dist
## paths:
## - htm.bindings*.whl
## - requirements.txt
## - include/htm
# deploy-s3:
#machine: true
#steps:
#- attach_workspace:
#at: dist
#- run:
#name: Deploying to S3
#command: |
#pip install awscli --upgrade --user
#tar -zcv -f htm_core-${CIRCLE_SHA1}-darwin64.tar.gz dist
#aws s3 cp htm_core-${CIRCLE_SHA1}-darwin64.tar.gz s3://artifacts.numenta.org/numenta/htm.core/circle/
# job: ARM64 via Docker + QEMU ("arm64-build-test")
arm64-build-test:
parallelism: 1
docker:
# CircleCI base Ubuntu 18.04 LTS Bionic with remote Docker access, etc.
# https://circleci.com/docs/2.0/circleci-images/#buildpack-deps
- image: circleci/buildpack-deps:bionic
steps:
- run:
# This is for local test builds using the CircleCI terminal app.
# Local Docker seems to use sudo, CircleCI Docker does not.
command: |
if [[ $CIRCLE_SHELL_ENV == *"localbuild"* ]]; then
echo "This is a local build. Enabling sudo for docker"
echo 'export CI_SUDO="sudo"' >> $BASH_ENV
else
echo 'export CI_SUDO=' >> $BASH_ENV
fi
source $BASH_ENV
- run: sudo apt-get -y install qemu-system
- checkout
- setup_remote_docker # access circleci's custom docker service
# here we make circleci x86 hardware think it's arm64 via docker+qemu
- run: $CI_SUDO docker run --rm --privileged multiarch/qemu-user-static:register --reset
- run:
name: Running docker build on ARM64
command: $CI_SUDO docker build -t htm-arm64-docker --build-arg arch=arm64 .
no_output_timeout: 2h
- run: $CI_SUDO docker run -it htm-arm64-docker
workflows:
version: 2
build-test-deploy:
jobs:
- build-and-test # Mac OS/X raw ("build-and-test")
- arm64-build-test # ARM64 docker/qemu ("arm64-build-test")