Skip to content

Add CI/CD pipeline for core build checks #5

Add CI/CD pipeline for core build checks

Add CI/CD pipeline for core build checks #5

name: Core Build Checks
on:
pull_request:
branches: [ main, PreReleaseMain ]
push:
branches: [ main, PreReleaseMain ]
jobs:
build-core-components:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt, clippy, rust-src
- name: Install stable Rust for bindgen
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install BPF dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
llvm \
libelf-dev \
libpcap-dev \
build-essential \
libbpf-dev \
linux-tools-generic \
linux-tools-common
- name: Install bindgen-cli
run: cargo install bindgen-cli
- name: Setup bpftool symlink
run: |
sudo ln -sf /usr/lib/linux-tools/*/bpftool /usr/local/bin/bpftool || \
sudo ln -sf /usr/lib/linux-tools-*/bpftool /usr/local/bin/bpftool
- name: Build CortexFlow Agent
run: |
cd core
chmod +x agent-api-build.sh
echo "🚀 Starting CortexFlow Agent build..."
./agent-api-build.sh || { echo "❌ Agent build failed"; exit 1; }
echo "✅ Agent build completed"
- name: Build CortexFlow Identity
run: |
cd core/src/components/identity
chmod +x build-identity.sh
echo "🚀 Starting CortexFlow Identity build..."
./build-identity.sh || { echo "❌ Identity build failed"; exit 1; }
echo "✅ Identity build completed"
- name: Build CortexFlow Metrics
run: |
cd core/src/components/metrics
chmod +x build-metrics.sh
echo "🚀 Starting CortexFlow Metrics build..."
./build-metrics.sh || { echo "❌ Metrics build failed"; exit 1; }
echo "✅ Metrics build completed"
- name: Verify Docker images were built
run: |
echo "Listing all Docker images:"
docker images
echo "Checking for core component images..."
if docker images | grep -q "cortexflow-agent"; then
echo "✅ cortexflow-agent image found"
else
echo "❌ cortexflow-agent image not found"
fi
if docker images | grep -q "identity"; then
echo "✅ identity image found"
else
echo "❌ identity image not found"
fi
if docker images | grep -q "metrics"; then
echo "✅ metrics image found"
else
echo "❌ metrics image not found"
fi
- name: Run basic tests if available
run: |
cd core
if [ -f "Cargo.toml" ]; then
cargo test --workspace
fi
- name: Cleanup build artifacts
run: |
docker system prune -f