mirror of
https://github.com/falcosecurity/falco.git
synced 2026-04-09 05:24:34 +00:00
87 lines
2.7 KiB
YAML
87 lines
2.7 KiB
YAML
name: CI Build
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- release/*
|
|
workflow_dispatch:
|
|
|
|
# Checks if any concurrent jobs under the same pull request or branch are being executed
|
|
# NOTE: this will cancel every workflow that is being ran against a PR as group is just the github ref (without the workflow name)
|
|
concurrency:
|
|
group: ${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
fetch-version:
|
|
uses: ./.github/workflows/reusable_fetch_version.yaml
|
|
|
|
build-dev-packages:
|
|
needs: [fetch-version]
|
|
uses: ./.github/workflows/reusable_build_packages.yaml
|
|
with:
|
|
arch: x86_64
|
|
version: ${{ needs.fetch-version.outputs.version }}
|
|
|
|
test-dev-packages:
|
|
needs: [fetch-version, build-dev-packages]
|
|
uses: ./.github/workflows/reusable_test_packages.yaml
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
static: ["static", ""]
|
|
with:
|
|
arch: x86_64
|
|
static: ${{ matrix.static != '' && true || false }}
|
|
version: ${{ needs.fetch-version.outputs.version }}
|
|
|
|
build-dev:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
machine: ['ubuntu-20.04']
|
|
buildmode: ['Debug', 'Release']
|
|
minimal: ['', 'minimal']
|
|
runs-on: ${{ matrix.machine }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Update base image
|
|
run: sudo apt update -y
|
|
|
|
- name: Install build dependencies
|
|
run: sudo DEBIAN_FRONTEND=noninteractive apt install libjq-dev libelf-dev libyaml-cpp-dev cmake build-essential git -y
|
|
|
|
- name: Install build dependencies (non-minimal)
|
|
if: matrix.minimal != 'minimal'
|
|
run: sudo DEBIAN_FRONTEND=noninteractive apt install libssl-dev libyaml-dev libc-ares-dev libprotobuf-dev protobuf-compiler libgrpc++-dev protobuf-compiler-grpc rpm libcurl4-openssl-dev linux-headers-$(uname -r) clang llvm -y
|
|
|
|
- name: Prepare project
|
|
run: |
|
|
mkdir build
|
|
pushd build
|
|
cmake \
|
|
-DBUILD_FALCO_UNIT_TESTS=On \
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.buildmode }} \
|
|
-DBUILD_BPF=${{ matrix.minimal == 'minimal' && 'OFF' || 'ON' }} \
|
|
-DBUILD_DRIVER=${{ matrix.minimal == 'minimal' && 'OFF' || 'ON' }} \
|
|
-DMINIMAL_BUILD=${{ matrix.minimal == 'minimal' && 'ON' || 'OFF' }} \
|
|
..
|
|
popd
|
|
|
|
- name: Build
|
|
run: |
|
|
pushd build
|
|
KERNELDIR=/lib/modules/$(uname -r)/build make -j4 all
|
|
popd
|
|
|
|
- name: Run unit tests
|
|
run: |
|
|
pushd build
|
|
sudo ./unit_tests/falco_unit_tests
|
|
popd
|