-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: try Github Actions as CI provider #688
Changes from all commits
7ed3e8e
6e9433e
385966d
cbe73a4
c100cfe
46514b2
1e1ee2a
9851bd9
cb93666
b311854
839dff8
f3ca3d9
7c8b594
4cf5087
ae3ec97
0a87372
7ae9903
750db07
7102d56
2fbd707
63f01c6
6879513
f717aaa
0a2536d
d663d19
530343c
e725466
d19f0c8
9aa6877
97c8481
95c100a
440b713
ccd9687
43628c4
6b1ad36
b00e537
a934eda
12448e0
08c8cb9
fde3bb8
cb06516
9170cd8
5e7a574
6e6f29e
4cb136b
f541f95
b95e9be
d03e2ab
68092ac
18f099f
149e964
d40c636
dd9a64a
2159d9d
47b5af9
3f7a8bc
9b33317
d09a87d
4c28afe
5a8f08e
5803bd5
17b9d5d
5513580
341b09a
86250e7
39058ea
7166ffd
2b0abc5
257267f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: ARM64 build | ||
|
||
on: | ||
# run every day of the week at 06:00 | ||
schedule: | ||
- cron: 0 6 * * * | ||
|
||
jobs: | ||
build-arm64-docker: | ||
name: Build for ARM64 on Docker | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Install docker | ||
run: | | ||
# bug in ubuntu, conflicts with docker.io | ||
sudo apt-get update | ||
sudo apt-get remove --purge -y moby-engine moby-cli | ||
sudo apt-get install -y qemu-system docker.io | ||
|
||
- name: Setup ARM64 build env | ||
run: | | ||
uname -a | ||
sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset | ||
uname -a | ||
|
||
- uses: actions/checkout@v1 | ||
|
||
- name: ARM64 build | ||
run: | | ||
sudo docker build -t htm-arm64-docker --build-arg arch=arm64 . | ||
uname -a | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
name: htm.core build | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'v*.*.*' # vX.Y.Z release tag | ||
# 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.7] | ||
os: [ubuntu-18.04, windows-2019, macOS-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Versions | ||
run: | | ||
python --version | ||
cmake --version | ||
c++ --version | ||
|
||
- name: Install dependencies (gcc-8) | ||
if: matrix.os == 'ubuntu-18.04' | ||
env: | ||
CC: gcc-8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. setting custom gcc (gcc-8, so we use c++17 and not :boost) is quite challenging here |
||
CXX: g++-8 | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install gcc-8 g++-8 | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install -r requirements.txt | ||
python setup.py configure | ||
|
||
- name: Install dependencies | ||
if: matrix.os != 'ubuntu-18.04' | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install -r requirements.txt | ||
python setup.py configure | ||
|
||
- name: build htmcore with setup.py | ||
run: python setup.py install --user | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. multi-platform Release build is darn easy now! |
||
|
||
- name: C++ & Python Tests | ||
run: python setup.py test | ||
|
||
- name: Memory leaks check (valgrind) | ||
if: matrix.os == 'ubuntu-18.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/benchmark_hotgym 5 || exit 1 | ||
|
||
- name: Release (make package) | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
run: | | ||
python setup.py bdist_wheel | ||
cd build/scripts | ||
cmake --build . --config Release --target install # aka make install ,but multiplatform | ||
cmake --build . --config Release --target package # make package | ||
|
||
- name: Release (deploy) | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
# from https://github.com/marketplace/actions/gh-release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GH Release is easy now |
||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
build/scripts/htm_core-v* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: pre-PyPI | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
#copy dist data to /dist, where PyPI Action expects it | ||
run: | | ||
cp -a build/Release/distr/dist . | ||
ls dist | ||
|
||
- name: Publish to PyPI | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PYPI is easy |
||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
repository_url: https://test.pypi.org/legacy/ #TODO rm for real pypi | ||
|
||
|
||
|
||
build-debug: | ||
name: Build and test in Debug mode | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debug build for c++ tests |
||
#currently cannot run on Linux & Debug due to a bug in YAML parser: issue #218 | ||
runs-on: macOS-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Install dependencies (Debug) | ||
run: | | ||
echo "built type: ${CMAKE_BUILD_TYPE}" | ||
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 | ||
breznak marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,36 +6,39 @@ ARG arch=amd64 | |
|
||
# Multiarch Debian 10 Buster (amd64, arm64, etc). | ||
# https://hub.docker.com/r/multiarch/debian-debootstrap | ||
FROM multiarch/debian-debootstrap:$arch-buster | ||
FROM multiarch/debian-debootstrap:${arch}-buster | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y \ | ||
RUN apt-get install -y --no-install-suggests \ | ||
cmake \ | ||
g++ \ | ||
g++-8 \ | ||
git-core \ | ||
libyaml-dev \ | ||
python \ | ||
python-dev \ | ||
python-numpy \ | ||
python-pip | ||
python3-minimal \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated our Dockerfile to python3 |
||
python3-dev \ | ||
python3-numpy \ | ||
python3-pip \ | ||
python3-venv | ||
|
||
ADD . /usr/local/src/htm.core | ||
WORKDIR /usr/local/src/htm.core | ||
|
||
# Setup py env | ||
#RUN python3 -m venv pyenv && . pyenv/bin/activate | ||
RUN pip3 install --upgrade setuptools pip wheel | ||
#RUN export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.7/dist-packages | ||
|
||
# Install | ||
RUN pip install --upgrade setuptools | ||
RUN pip install wheel | ||
RUN pip install \ | ||
RUN pip3 install \ | ||
# Explicitly specify --cache-dir, --build, and --no-clean so that build | ||
# artifacts may be extracted from the container later. Final built python | ||
# packages can be found in /usr/local/src/htm.core/bindings/py/dist | ||
# --cache-dir /usr/local/src/htm.core/pip-cache \ | ||
# --build /usr/local/src/htm.core/pip-build \ | ||
# --no-clean \ | ||
-r bindings/py/packaging/requirements.txt | ||
RUN python setup.py install | ||
-r requirements.txt | ||
RUN python3 setup.py install --force | ||
|
||
# Test | ||
RUN ./build/Release/bin/unit_tests | ||
RUN python setup.py test | ||
RUN python3 setup.py test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ Fork or download the HTM-Community htm.core repository from https://github.com/h | |
``` | ||
cd to-repository-root | ||
python -m pip install --user --upgrade pip setuptools setuptools-scm wheel | ||
python -m pip install --no-cache-dir --user -r bindings/py/packaging/requirements.txt | ||
python -m pip install --no-cache-dir --user -r requirements.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved requirements here, TODO might need move back (for pypi dist/ build) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, as I mentioned before, in order to get the requirements.txt file into the wheel it needs to somehow get into the Release/distr/dist/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed by copying /requirements.txt to build/Release/distr/dist during |
||
``` | ||
|
||
Be sure you are running the right version of python. Check it with the following command: | ||
|
@@ -275,7 +275,7 @@ distribution packages as listed and rename them as indicated. Copy these to | |
### There are two sets of Unit Tests: | ||
|
||
* C++ Unit tests -- to run: `./build/Release/bin/unit_tests` | ||
* Python Unit tests -- to run: `python setup.py test` | ||
* Python Unit tests -- to run: `python setup.py test` (runs also the C++ tests above) | ||
|
||
# Examples | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARM build takes 4h, so separated to a standalone file and runs on schedure (nightly at 6am)