The macos job (macos-15, Homebrew deps, Qt app skipped) builds and runs meson test. It only runs on GitHub: Forgejo also reads .github/workflows and has no macOS runner. README: macOS build, the Linux to macOS backend map, ES requirements and installed files. API_CONTRACT: macOS socket path and peer credentials, the endpoint_security and libproc backend values, and the macOS status fields. DEVELOPER: platform map and the GitHub + Forgejo remotes. AGENTS: current state of the port, including that the ES backends have not run live yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
132 lines
3.7 KiB
YAML
132 lines
3.7 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
|
|
strategy:
|
|
matrix:
|
|
compiler: [gcc, clang]
|
|
buildtype: [debug, release]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
meson \
|
|
ninja-build \
|
|
ccache \
|
|
clang \
|
|
llvm \
|
|
libssl-dev \
|
|
libbpf-dev \
|
|
libyara-dev \
|
|
libzstd-dev \
|
|
nlohmann-json3-dev \
|
|
libcurl4-openssl-dev \
|
|
libarchive-dev \
|
|
pkg-config
|
|
|
|
- name: Setup compiler
|
|
run: |
|
|
if [ "${{ matrix.compiler }}" = "clang" ]; then
|
|
echo "CC=clang" >> $GITHUB_ENV
|
|
echo "CXX=clang++" >> $GITHUB_ENV
|
|
else
|
|
echo "CC=gcc" >> $GITHUB_ENV
|
|
echo "CXX=g++" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Setup ccache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.ccache
|
|
key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ matrix.buildtype }}-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ matrix.buildtype }}-
|
|
|
|
- name: Configure
|
|
run: |
|
|
export PATH="/usr/lib/ccache:$PATH"
|
|
meson setup builddir --buildtype=${{ matrix.buildtype }}
|
|
|
|
- name: Build
|
|
run: |
|
|
export PATH="/usr/lib/ccache:$PATH"
|
|
meson compile -C builddir
|
|
|
|
- name: Test
|
|
run: |
|
|
meson test -C builddir --verbose
|
|
|
|
- name: Upload artifacts
|
|
if: matrix.compiler == 'clang' && matrix.buildtype == 'release'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: strawberry-binary
|
|
path: builddir/src/strawberry
|
|
|
|
macos:
|
|
# GitHub-hosted runners only. Forgejo also reads .github/workflows (when
|
|
# .forgejo/workflows is absent) and has no macOS runner.
|
|
if: ${{ github.server_url == 'https://github.com' }}
|
|
runs-on: macos-15
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
brew install meson ninja pkgconf ccache yara libarchive zstd nlohmann-json openssl@3
|
|
|
|
- name: Setup ccache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/Library/Caches/ccache
|
|
key: ${{ runner.os }}-ccache-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-ccache-
|
|
|
|
- name: Configure
|
|
run: |
|
|
# libarchive is keg-only in Homebrew. The desktop app (Qt6) is skipped
|
|
# to keep the job short; Endpoint Security code is compiled (SDK) but
|
|
# its live test needs root + entitlement and is not run here.
|
|
meson setup builddir -Denable_tests=true -Denable_app=disabled \
|
|
-Dpkg_config_path="$(brew --prefix)/opt/libarchive/lib/pkgconfig"
|
|
|
|
- name: Build
|
|
run: meson compile -C builddir
|
|
|
|
- name: Test
|
|
run: meson test -C builddir --print-errorlogs
|
|
|
|
docker:
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build Docker development image
|
|
run: docker build --target dev -t strawberry-linux-dev .
|
|
|
|
- name: Build Docker self-test image
|
|
run: docker build --target test -t strawberry-linux-test .
|
|
|
|
- name: Run privileged live BPF smoke
|
|
run: docker run --rm --privileged strawberry-linux-test ./builddir/tests/process_monitor_live_smoke
|
|
|
|
- name: Run privileged live BPF pipeline smoke
|
|
run: docker run --rm --privileged strawberry-linux-test ./builddir/tests/live_bpf_pipeline_smoke
|
|
|
|
- name: Run privileged live BPF daemon smoke
|
|
run: docker run --rm --privileged strawberry-linux-test ./builddir/tests/live_bpf_daemon_smoke
|