diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79341615105..ae4eb31d620 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: uses: ./.github/workflows/reusable_build_dev.yaml with: arch: x86_64 - operating-systems: "['ubuntu-22.04']" git_ref: ${{ github.event.pull_request.head.sha }} minimal: true build_type: Debug @@ -54,20 +53,29 @@ jobs: uses: ./.github/workflows/reusable_build_dev.yaml with: arch: x86_64 - operating-systems: "['ubuntu-22.04']" git_ref: ${{ github.event.pull_request.head.sha }} minimal: false build_type: Debug cmd: "echo $(build/userspace/falco/falco -c ./falco.yaml --version | grep 'Engine:' | awk '{print $2}') $(echo $(build/userspace/falco/falco -c ./falco.yaml --version | grep 'Schema version:' | awk '{print $3}') $(build/userspace/falco/falco -c ./falco.yaml --list --markdown | grep '^`' | sort) $(build/userspace/falco/falco -c ./falco.yaml --list-events | sort) | sha256sum)" build-dev-others-amd64: - uses: ./.github/workflows/reusable_build_dev.yaml - with: - arch: x86_64 - operating-systems: "['windows-latest', 'macos-latest']" - git_ref: ${{ github.event.pull_request.head.sha }} - minimal: true - build_type: Debug + name: build-dev-others-amd64 + strategy: + fail-fast: false + matrix: + os: [windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Libs + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + with: + fetch-depth: 0 + + - name: Build + run: | + mkdir -p build + cd build && cmake -DUSE_BUNDLED_DEPS=ON -DCMAKE_BUILD_TYPE=Release -DMINIMAL_BUILD=ON .. + cmake --build . --config Release # checks the falco engine checksum for consistency check-engine-checksum: diff --git a/.github/workflows/reusable_build_dev.yaml b/.github/workflows/reusable_build_dev.yaml index 3c770bd1a29..8ecbd5d1c7b 100644 --- a/.github/workflows/reusable_build_dev.yaml +++ b/.github/workflows/reusable_build_dev.yaml @@ -10,11 +10,6 @@ on: description: x86_64 or aarch64 required: true type: string - operating-systems: - description: "Optional input to set a list of operating systems which the workflow uses. Defaults to ['ubuntu-22.04', 'windows-latest', 'macos-latest'] if not set" - required: false - type: string - default: "['ubuntu-22.04', 'windows-latest', 'macos-latest']" minimal: description: Minimal build required: true @@ -36,12 +31,8 @@ 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.os }} + runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || 'ubuntu-22.04' }} container: ${{ (inputs.arch == 'aarch64' && 'ubuntu:22.04') || '' }} - strategy: - fail-fast: false - matrix: - os: ${{fromJson(inputs.operating-systems)}} outputs: cmdout: ${{ steps.run_cmd.outputs.out }} steps: @@ -52,19 +43,16 @@ jobs: ref: ${{ inputs.git_ref }} - name: Update base image - if: matrix.os == 'ubuntu-22.04' run: sudo apt update -y - name: Install build dependencies - 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.os == 'ubuntu-22.04' + if: inputs.minimal != true 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 (linux) - if: matrix.os == 'ubuntu-22.04' + - name: Prepare project run: | mkdir build pushd build @@ -76,58 +64,22 @@ jobs: -DMINIMAL_BUILD=${{ inputs.minimal == true && 'ON' || 'OFF' }} \ .. popd - - - name: Prepare project (windows/macos) - if: matrix.os != 'ubuntu-22.04' - run: | - mkdir build - cd build - cmake -DBUILD_FALCO_UNIT_TESTS=On -DMINIMAL_BUILD=ON -DUSE_BUNDLED_DEPS=ON .. - cd .. - - name: Build (linux) - if: matrix.os == 'ubuntu-22.04' + - name: Build run: | pushd build KERNELDIR=/lib/modules/$(uname -r)/build make -j4 all popd - - name: Build (windows/macos) - if: matrix.os != 'ubuntu-22.04' - run: | - cmake --build build --config Release - - name: Run unit tests - if: matrix.os != 'windows-latest' run: | pushd build - sudo ./unit_tests/falco_unit_tests + sudo ./unit_tests/falco_unit_tests popd - - name: Run unit tests (windows) - if: matrix.os == 'windows-latest' - run: | - build/unit_tests/falco_unit_tests.exe - - - name: Upload experimental windows artifact - if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v3 - with: - name: falco-master-${{ inputs.git_ref }}-${{ matrix.os }}-x86_64.exe - path: | - build/userspace/falco/falco.exe - - - name: Upload experimental macos artifact - if: matrix.os == 'macos-latest' - uses: actions/upload-artifact@v3 - with: - name: falco-master-${{ inputs.git_ref }}-${{ matrix.os }}-x86_64 - path: | - build/userspace/falco/falco - - name: Run command id: run_cmd - if: inputs.cmd != '' && matrix.os != 'windows-latest' + if: inputs.cmd != '' run: | OUT=$(${{ inputs.cmd }}) echo "out=${OUT}" >> $GITHUB_OUTPUT diff --git a/CMakeLists.txt b/CMakeLists.txt index a13602713c4..bd68c697583 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ else() endif() message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") -if(MINIMAL_BUILD OR WIN32 OR APPLE) +if(MINIMAL_BUILD) set(MINIMAL_BUILD_FLAGS "-DMINIMAL_BUILD") endif()