Skip to content

Commit

Permalink
CI: add travis ci build
Browse files Browse the repository at this point in the history
Now that seastar has one, it's easy to depend
on a travis ci build
  • Loading branch information
emaxerrno committed Sep 29, 2017
1 parent b3c3408 commit c4378df
Show file tree
Hide file tree
Showing 13 changed files with 148 additions and 20 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
dist: trusty
sudo: required
language: cpp
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5

before_script: cd meta && source source_ansible_bash && travis_wait 30 ansible-playbook playbooks/devbox_all.yml

script:
- ./debug
- ./release
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.2)
project(SMF VERSION "0.0.1")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -v" )
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [smf](http://senior7515.github.io/smf/)
# [smf](http://senior7515.github.io/smf/) [![Travis Build Status](https://travis-ci.org/senior7515/smf.svg?branch=master)](https://travis-ci.org/senior7515/smf)

**smf** is pronounced **/smɝf/**

Expand Down
7 changes: 6 additions & 1 deletion debug
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ cmake -Wdev \
-DCMAKE_BUILD_TYPE=Debug $git_root

nprocs=$(grep -c ^processor /proc/cpuinfo)
ninja-build -v
os=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
if [[ ${os} == "ubuntu" ]]; then
ninja -v
else
ninja-build -v
fi
ctest --output-on-failure \
--force-new-ctest-process \
--schedule-random \
Expand Down
22 changes: 22 additions & 0 deletions meta/playbooks/roles/compilation_tooling/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,25 @@
- clang
- doxygen
- gtest-devel
when: ansible_os_family == "RedHat"

- name: ubuntu add tools repo
become: yes
apt_repository:
repo: 'ppa:ubuntu-toolchain-r/test'
when: ansible_os_family == "Debian"

- name: Install all dev system tools
become: yes
apt: name='{{item}}'
with_items:
- g++
- ccache
- cmake
- make
- git
- binutils
- clang
- doxygen
- libgtest-dev
when: ansible_os_family == "Debian"
4 changes: 4 additions & 0 deletions meta/playbooks/roles/cpplint/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
force=yes
version='6c8669e'

- file:
path: "{{third_party_dir}}/bin"
state: directory

- name: setup symlink w/ thrid party bin
file:
src: '{{goobly_cache_dir}}/google_styleguide/cpplint/cpplint.py'
Expand Down
2 changes: 1 addition & 1 deletion meta/playbooks/roles/hdrhistogram/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- name: install analysis deps
become: yes
dnf:
package:
name='{{item}}'
with_items:
- gnuplot
Expand Down
53 changes: 52 additions & 1 deletion meta/playbooks/roles/seastar/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# ignore: boost-devel libs because we compile it manually from source
# and pass in the flags. Otherwise add -boost-devel as a library here
#

- name: install deps
become: yes
dnf:
Expand All @@ -27,6 +28,35 @@
- protobuf-compiler
- libunwind-devel
- systemtap-sdt-devel
when: ansible_os_family == "RedHat"


- name: install deps
become: yes
apt:
name='{{item}}'
with_items:
- libaio-dev
- ninja-build
- ragel
- libhwloc-dev
- libnuma-dev
- libpciaccess-dev
- libcrypto++-dev
- libxen-dev
- libxml2-dev
- xfslibs-dev
- libgnutls28-dev
- liblz4-dev
- libsctp-dev
- g++-5
- libprotobuf-dev
- protobuf-compiler
- python3
- libunwind8-dev
- systemtap-sdt-dev
- libtool
when: ansible_os_family == "Debian"


- name: programs for posix ethernet tunning and IRQ balance
Expand All @@ -35,6 +65,7 @@
name='{{item}}'
with_items:
- hwloc
when: ansible_os_family == "RedHat"


- name: Sync soure from git
Expand All @@ -46,7 +77,7 @@
update=yes
recursive=yes
force=yes
version='0ab7ae5'
version='4e971fa'

- name: configure sources with dpdk enabled
shell:
Expand All @@ -56,9 +87,29 @@
args:
chdir: '{{goobly_cache_dir}}/seastar'
creates: '{{goobly_cache_dir}}/seastar/build.ninja'
when: ansible_os_family == "RedHat"

- name: configure sources with dpdk enabled
shell:
./configure.py --enable-dpdk --static-boost --compiler=g++-5 \
--with=libseastar.a --with=seastar.pc \
--cflags="-isystem {{third_party_dir}}/include" \
--ldflags="-L{{third_party_dir}}/lib"
args:
chdir: '{{goobly_cache_dir}}/seastar'
creates: '{{goobly_cache_dir}}/seastar/build.ninja'
when: ansible_os_family == "Debian"

- name: build with ninja
shell: "ninja-build -j$((({{ansible_processor_vcpus}}-1)))"
args:
chdir: '{{goobly_cache_dir}}/seastar'
creates: '{{goobly_cache_dir}}/seastar/build/release/libseastar.a'
when: ansible_os_family == "RedHat"

- name: build with ninja
shell: "ninja -j$((({{ansible_processor_vcpus}}-1)))"
args:
chdir: '{{goobly_cache_dir}}/seastar'
creates: '{{goobly_cache_dir}}/seastar/build/release/libseastar.a'
when: ansible_os_family == "Debian"
9 changes: 9 additions & 0 deletions meta/playbooks/roles/smf_gen_libs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
with_items:
- gflags-devel
- glog-devel
when: ansible_os_family == "RedHat"

- name: libraries for the rpc generator programs
become: yes
apt: name='{{item}}'
with_items:
- libgflags-dev
- libgoogle-glog-dev
when: ansible_os_family == "Debian"
10 changes: 10 additions & 0 deletions meta/playbooks/roles/zstd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
with_items:
- zlib-devel
- zlib-static
when: ansible_os_family == "RedHat"

- name: install deps
become: yes
apt:
name='{{item}}'
with_items:
- zlib1g-dev
when: ansible_os_family == "Debian"


- name: Sync soure from git
git:
Expand Down
3 changes: 2 additions & 1 deletion meta/playbooks/system_wide_deps.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---

# enable later when we finish the tests - american_fuzzy_lop

- name: Install & build all development dependencies
hosts: localhost
roles:
- compilation_tooling
- american_fuzzy_lop
- cpplint
29 changes: 18 additions & 11 deletions meta/source_ansible_bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ DIR=$(git rev-parse --show-toplevel)/meta
if [[ -e ${DIR}/tmp/bin/activate ]]; then
source ${DIR}/tmp/bin/activate
else
sudo dnf install -y \
python-devel \
python-pip \
libffi-devel \
openssl-devel \
redhat-rpm-config \
python-dnf \
libselinux-python

if [[ $(which apt) != "" ]]; then
sudo apt-get update
sudo apt-get install -y \
software-properties-common \
python-dev \
python-pip
else
sudo dnf install -y \
python-devel \
python-pip \
libffi-devel \
openssl-devel \
redhat-rpm-config \
python-dnf \
libselinux-python
fi
sudo pip install pip --upgrade
sudo pip install virtualenv
echo "Creating work directory ${PWD}/tmp"
Expand All @@ -25,9 +32,9 @@ fi

# check if git config stuff is set, ansible needs it
if [[ $(git config --global user.email) == "" ]]; then
git config --global user.email "[email protected]"
git config --global user.email "[email protected]"
fi

if [[ $(git config --global user.name) == "" ]]; then
git config --global user.name "commitbot"
git config --global user.name "commitbot"
fi
9 changes: 6 additions & 3 deletions release
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ cmake --graphviz=$build_dir/dependencies.dot \
if [[ $1 != "quick" ]]; then
cmake --build $build_dir --target doc
fi

ninja-build -v
os=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
if [[ ${os} == "ubuntu" ]]; then
ninja -v
else
ninja-build -v
fi
ctest -V -j$nprocs --force-new-ctest-process

0 comments on commit c4378df

Please sign in to comment.