Skip to content

🦩 Update: Flamingo Code Documentation #104

🦩 Update: Flamingo Code Documentation

🦩 Update: Flamingo Code Documentation #104

Workflow file for this run

name: OSQuery Test
permissions:
contents: write
packages: write
actions: write
pull-requests: write
attestations: write
id-token: write
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [master]
paths-ignore:
- "**/*.md"
concurrency:
group: pr-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
REGISTRY: "ghcr.io"
ORGANISATION: ${{ github.repository_owner }}
REPOSITORY: ${{ github.event.repository.name }}
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
CMAKE_BUILD_TYPE: Release
BINARY_NAME: osqueryd
# =============================================================================
# JOBS
# =============================================================================
jobs:
build_macos:
name: "Build C Client for (${{ matrix.os }} ${{ matrix.os_arch }})"
runs-on: ${{ matrix.os }}
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: "macOS x86-64"
os: macos-15-intel
os_arch: x86-64
cmake_arch: x86_64
artifact_name: osquery-macos-x64
- name: "macOS ARM64"
os: macos-15 # pinned: Xcode 26 on macos-latest fails to compile boost mpl
os_arch: arm64
cmake_arch: arm64
artifact_name: osquery-macos-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Xcode Command Line Tools
shell: bash
run: |
# Install Xcode if not already installed
if ! xcode-select -p >/dev/null 2>&1; then
echo "Installing Xcode Command Line Tools..."
xcode-select --install
# Wait for installation to complete
while ! xcode-select -p >/dev/null 2>&1; do
echo "Waiting for Xcode Command Line Tools installation..."
sleep 10
done
fi
- name: Install macOS Dependencies
run: brew install ccache git git-lfs cmake python clang-format flex bison cppcheck
shell: bash
# ccache 4.x defaults to ~/Library/Caches/ccache on macOS
- name: Configure ccache
run: |
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=2G" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
- name: Cache ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.os_arch }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.os_arch }}-ccache-
- name: Setup Build Environment
run: |
echo "Setting up build environment for ${{ matrix.os_arch }}..."
export SDKROOT=$(xcrun --show-sdk-path)
export CFLAGS="-isysroot $SDKROOT"
export CXXFLAGS="-isysroot $SDKROOT"
echo "SDKROOT=$SDKROOT" >> $GITHUB_ENV
echo "CFLAGS=-isysroot $SDKROOT" >> $GITHUB_ENV
echo "CXXFLAGS=-isysroot $SDKROOT" >> $GITHUB_ENV
- name: Configure CMake
run: |
echo "Creating build directory and configuring..."
mkdir -p build && cd build
cmake \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.CMAKE_OSX_DEPLOYMENT_TARGET }} \
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_OSX_SYSROOT=$SDKROOT \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} \
-DOSQUERY_VERSION="5.9.1" \
..
echo "CMake configuration completed"
- name: Build Project
run: |
echo "Starting build for ${{ matrix.os_arch }}..."
cd build
CPU_COUNT=$(sysctl -n hw.ncpu)
echo "Building with $CPU_COUNT parallel jobs"
time cmake --build . -j $CPU_COUNT
echo "Build completed successfully"
- name: ccache statistics
if: always()
run: ccache --show-stats
build_windows:
name: "Build C Client for (${{ matrix.os }} ${{ matrix.os_arch }})"
runs-on: ${{ matrix.os }}
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
include:
- name: "Windows x64"
os: windows-2022 # pinned: windows-latest is VS 2026; generator below needs VS 17
os_arch: x64
artifact_name: osquery-windows-x64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup Visual Studio Build Tools
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.os_arch }}
- name: Configure CMake for ${{ matrix.os }}
run: |
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A ${{ matrix.os_arch }} -DOSQUERY_VERSION="5.9.1" ..
- name: Build OSQuery for Windows ${{ matrix.os_arch }} with MSBuild
run: |
cd build
cmake --build . --config RelWithDebInfo -j10
all-checks:
name: "All Checks"
needs: [build_macos, build_windows]
runs-on: ubuntu-latest
if: always()
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
- run: echo "All checks passed"