Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Oct 27, 2023
1 parent c1a9aab commit 7b8776b
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/reusable_build_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ on:
jobs:
build-and-test:
# See https://github.com/actions/runner/issues/409#issuecomment-1158849936
runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || '${{matrix.operating-systems}}' }}
runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || matrix.os }}
container: ${{ (inputs.arch == 'aarch64' && 'ubuntu:22.04') || '' }}
strategy:
fail-fast: false
matrix:
operating-systems: ${{fromJson(inputs.operating-systems)}}
os: ${{fromJson(inputs.operating-systems)}}
outputs:
cmdout: ${{ steps.run_cmd.outputs.out }}
steps:
Expand All @@ -52,45 +52,46 @@ jobs:
ref: ${{ inputs.git_ref }}

- name: Update base image
if: matrix.operating-systems == 'ubuntu:22.04'
if: matrix.os == 'ubuntu-22.04'
run: sudo apt update -y

- name: Install build dependencies
if: matrix.operating-systems == 'ubuntu:22.04'
if: matrix.os == 'ubuntu-22.04'
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: inputs.minimal != true && matrix.operating-systems == 'ubuntu:22.04'
if: inputs.minimal != true && matrix.os == 'ubuntu-22.04'
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=${{ inputs.build_type }} \
-DBUILD_BPF=${{ inputs.minimal == true && 'OFF' || 'ON' }} \
-DBUILD_DRIVER=${{ inputs.minimal == true && 'OFF' || 'ON' }} \
-DMINIMAL_BUILD=${{ inputs.minimal == true && 'ON' || 'OFF' }} \
..
popd
cd build
cmake -DBUILD_FALCO_UNIT_TESTS=On -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DBUILD_BPF=${{ inputs.minimal == true && 'OFF' || 'ON' }} -DBUILD_DRIVER=${{ inputs.minimal == true && 'OFF' || 'ON' }} -DMINIMAL_BUILD=${{ inputs.minimal == true && 'ON' || 'OFF' }} -DUSE_BUNDLED_DEPS=${{ matrix.os == 'ubunut-22.04' && 'OFF' || 'ON' }} ..
cd ..
- name: Build
if: matrix.os != 'windows-latest'
run: |
pushd build
KERNELDIR=/lib/modules/$(uname -r)/build make -j4 all
popd
- name: Build
if: matrix.os == 'windows-latest'
run: |
cmake -B build -j 4
- name: Run unit tests
if: matrix.os != 'windows-latest'
run: |
pushd build
sudo ./unit_tests/falco_unit_tests
popd
- name: Run command
id: run_cmd
if: inputs.cmd != ''
if: inputs.cmd != '' && matrix.os != 'windows-latest'
run: |
OUT=$(${{ inputs.cmd }})
echo "out=${OUT}" >> $GITHUB_OUTPUT

0 comments on commit 7b8776b

Please sign in to comment.