forked from htm-community/htm.core
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (91 loc) · 3.43 KB
/
pr.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
name: PR
on:
# run on pull_request events that target the master branch
pull_request:
branches:
- master
# run every day of the week at 02:00
schedule:
- cron: 0 2 * * *
jobs:
build:
name: Building on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
#max-parallel: 4
matrix:
python-version: [3.8.x]
# https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners
os: [ubuntu-20.04, windows-2019, macos-10.15] #TODO upgrade to macos-11.0 when available on GH Actions CI
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} for PR
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Versions
run: |
python --version
cmake --version
c++ --version
# - name: Install gcc-8
# if: matrix.os == 'ubuntu-18.04'
# env:
# CC: gcc-8
# CXX: g++-8
# run: |
# sudo apt-get update
# sudo apt-get -y install gcc-8 g++-8
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 \
# 100 \
# --slave /usr/bin/g++ g++ /usr/bin/g++-8 \
# --slave /usr/bin/gcov gcov /usr/bin/gcov-8 \
# --slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-8 \
# --slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-8 \
# --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-8 \
# --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-8 \
# --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-8
# sudo update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-8 100
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python setup.py configure
- name: build htmcore with setup.py
run: python setup.py install --user --force
- name: C++ & Python Tests
run: python setup.py test
- name: Memory leaks check (valgrind)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get -y install valgrind
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PWD}/build/Release/lib valgrind --show-leak-kinds=definite,indirect,possible,reachable --track-origins=yes --num-callers=40 --error-exitcode=3 ./build/Release/bin/hello 5 || exit 1
- name: MNIST example
run: ./build/Release/bin/mnist_sp 100 || exit 2
- name: NetworkAPI example
run: ./build/Release/bin/napi_hello 1000 || exit 3
- name: Hello example (dynamically linked)
if: matrix.os == 'ubuntu-20.04'
run: LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PWD}/build/Release/lib ./build/Release/bin/dynamic_hello 1000 || exit 4
- uses: actions/upload-artifact@v2
with:
name: "pr_build"
path: build/Release/distr/dist
build-debug:
name: Build and test in Debug mode
#currently cannot run on Linux & Debug due to a bug in YAML parser: issue #218
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies (Debug)
run: |
mkdir -p build/scripts
cd build/scripts
cmake ../.. -DCMAKE_BUILD_TYPE=Debug
- name: Debug build
run: |
cd build/scripts
make -j2 && make install
- name: C++ Tests
run: |
cd build/scripts
../Debug/bin/unit_tests