Skip to content

Commit

Permalink
Automatic build of tagged releases;
Browse files Browse the repository at this point in the history
  • Loading branch information
sommerlukas committed Apr 21, 2021
1 parent a54f738 commit 515e46d
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 3 deletions.
134 changes: 134 additions & 0 deletions .github/workflows/release-build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: release-build-linux
on:
push:
tags:
- "v*"

jobs:

release-build-spnc:
runs-on: self-hosted
steps:
- name: Install Prerequisites
run: |
sudo apt update
apt install -y git gcc clang cmake ninja-build zlib1g zlib1g-dev python3 lld doxygen graphviz autoconf automake libtool python3-venv python3-pip python3-dev pkg-config libelf-dev libelf1
- name: Pull LLVM
uses: actions/checkout@v2
with:
repository: llvm/llvm-project
ref: f8d3f47e1fd09392aa30df83849b25acd8c59a25
path: llvm/llvm-src

- name: Build LLVM
run: |
cd llvm
mkdir -p llvm-bin
cd llvm-bin
cmake -G Ninja -DLLVM_ENABLE_PROJECTS="mlir;clang;compiler-rt" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" -DLLVM_ENABLE_LLD=ON -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_RTTI=ON -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DLLVM_OPTIMIZED_TABLEGEN=ON ../llvm-src/llvm/
ninja
echo "$GITHUB_WORKSPACE/llvm/llvm-bin/bin" >> $GITHUB_PATH
- name: Pull Pybind11
uses: actions/checkout@v2
with:
repository: pybind/pybind11
path: pybind11

- name: Build Pybind11
run: |
cd pybind11
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/pybind11/install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 ..
make -j
make install
- name: Pull spdlog
uses: actions/checkout@v2
with:
repository: gabime/spdlog
path: spdlog

- name: Build spdlog
run: |
cd spdlog
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/spdlog/install -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
make -j
make install
- name: Pull capnproto
uses: actions/checkout@v2
with:
repository: sandstorm-io/capnproto
path: capnproto

- name: Build capnproto
run: |
cd capnproto/c++
autoreconf -i
./configure --prefix=$GITHUB_WORKSPACE/capnproto/install --disable-shared --with-pic
make -j
make install
- name: Pull spnc
uses: actions/checkout@v2
with:
path: spn-compiler

- name: Build spnc
run: |
cd spn-compiler
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/llvm/llvm-bin/lib/cmake/llvm;$GITHUB_WORKSPACE/llvm/llvm-bin/lib/cmake/mlir;$GITHUB_WORKSPACE/pybind11/install/share/cmake/pybind11;$GITHUB_WORKSPACE/spdlog/install/lib/cmake/spdlog;$GITHUB_WORKSPACE/capnproto/install" -DLLVM_ENABLE_LLD=ON -DLLVM_ENABLE_ASSERTIONS=ON -DSPNC_BUILD_DOC=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF ..
make -j
- name: Test spnc
run: |
cd spn-compiler/build
make check-spnc-mlir
- name: Setup Python venv
run: |
mkdir -p python
cd python
python3 -m venv venv
- name: Test xspn
run: |
cd spn-compiler/xspn
source $GITHUB_WORKSPACE/python/venv/bin/activate
pip install -r requirements.txt
pip install wheel setuptools
python -m pytest
- name: Package xspn
run: |
cd spn-compiler/xspn
source $GITHUB_WORKSPACE/python/venv/bin/activate
python setup.py bdist_wheel
- name: Test Python interface
run: |
cd spn-compiler/python-interface
source $GITHUB_WORKSPACE/python/venv/bin/activate
python -m pytest
- name: Package Python interface
run: |
cd spn-compiler/python-interface
source $GITHUB_WORKSPACE/python/venv/bin/activate
python setup.py bdist_wheel
- name: Upload release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
spn-compiler/python-interface/dist/spnc*.whl
spn-compiler/xspn/dist/xspn*.whl
14 changes: 11 additions & 3 deletions python-interface/setup.py.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Auto-generated by CMake, do not edit!
#
import setuptools
from setuptools import setup, Distribution, find_packages
import shutil
import os

Expand All @@ -20,7 +20,14 @@ if not os.path.isfile(spncpyLib):
with open("requirements.txt", "r") as rf:
requirements = rf.readlines()

setuptools.setup(
# Specify that this has external modules to
# make sure that the resulting wheel is named
# with the platform name.
class BinaryDistribution(Distribution):
def has_ext_modules(foo):
return True

setup(
name="spnc",
version="0.1",
author="Embedded Systems and Applications Group, TU Darmstadt",
Expand All @@ -33,11 +40,12 @@ setuptools.setup(
"Operating System :: POSIX :: Linux",
"Programming Language :: C++"
],
packages=setuptools.find_packages(include=["spnc", "spnc.*"]),
packages=find_packages(include=["spnc", "spnc.*"]),
package_data={"spnc" : binaryPackages},
include_package_data=True,
install_requires=requirements,
setup_requires=["pytest-runner"],
tests_require=["pytest"],
test_suite="test",
distclass=BinaryDistribution
)

0 comments on commit 515e46d

Please sign in to comment.