build: initial workflow

Signed-off-by: Lorenzo Fontana <lo@linux.com>
This commit is contained in:
Lorenzo Fontana 2020-01-15 10:50:50 +01:00 committed by Leo Di Donato
parent 885a0e24f5
commit 79d9999b7e

View File

@ -1,7 +1,7 @@
version: 2 version: 2
jobs: jobs:
# generic ubuntu build # build using ubuntu LTS
build: "build/ubuntu-bionic":
docker: docker:
- image: ubuntu:bionic - image: ubuntu:bionic
steps: steps:
@ -13,12 +13,17 @@ jobs:
name: install dependencies name: install dependencies
command: apt install libssl-dev libyaml-dev libncurses-dev libc-ares-dev libprotobuf-dev protobuf-compiler libjq-dev libyaml-cpp-dev libgrpc++-dev protobuf-compiler-grpc rpm linux-headers-$(uname -r) libelf-dev cmake build-essential libcurl4-openssl-dev -y command: apt install libssl-dev libyaml-dev libncurses-dev libc-ares-dev libprotobuf-dev protobuf-compiler libjq-dev libyaml-cpp-dev libgrpc++-dev protobuf-compiler-grpc rpm linux-headers-$(uname -r) libelf-dev cmake build-essential libcurl4-openssl-dev -y
- run: - run:
name: build all name: prepare project
command: | command: |
mkdir build mkdir build
pushd build pushd build
cmake .. cmake ..
make -j4 all popd
- run:
name: build
command: |
pushd build
make -j all
popd popd
- run: - run:
name: run unit tests name: run unit tests
@ -26,27 +31,43 @@ jobs:
pushd build pushd build
make tests make tests
popd popd
# build using our own builder base image # build using our own builder base image using centos 7
builder: "build/centos7":
docker: docker:
- image: falcosecurity/falco-builder:dynamic-build # todo(fntlnz): replace this with the actual image once PR #968 is merged - image: falcosecurity/falco-builder:dynamic-builds # todo(fntlnz): replace this with the actual image once PR #968 is merged
steps: steps:
- checkout - checkout:
path: /source/falco
- run: - run:
name: prepare project name: prepare project
command: cmake command: /usr/bin/entrypoint cmake
- run:
name: prepare project
command: /usr/bin/entrypoint all
- persist_to_workspace: - persist_to_workspace:
root: . root: /
paths: paths:
- build/* - build
# execute integration tests based on the build results coming from the "builder" job # execute integration tests based on the build results coming from the "build/centos7" job
integration: "tests/integration":
docker: docker:
- image: falcosecurity/falco-tester:latest - image: falcosecurity/falco-tester:latest
steps: steps:
- checkout - checkout:
path: /source/falco
- attach_workspace: - attach_workspace:
at: build at: /build
- run: - run:
name: prepare project name: execute integration tests
command: cmake command: |
ls -la /
ls -la /build
workflows:
version: 2
build_and_test:
jobs:
- "build/ubuntu-bionic"
- "build/centos7"
- "tests/integration":
requires:
- "build/centos7"