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 - 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