feat: Add custom C++ extension for RocksDB integration and update Doc… #65
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Search Engine CI | |
| on: | |
| push: | |
| branches: [ "main", "feat/*" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| # 1. Docker Compose Build | |
| # This checks if all services can be built as containers. | |
| # It's the ultimate integration test for the build process. | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Services | |
| run: docker compose build | |
| # 2. C++ Crawler Native Build | |
| # Compiles the crawler directly on the runner to catch syntax/linker errors fast. | |
| crawler-build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./cpp/crawler | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake libcurl4-openssl-dev libpqxx-dev libhiredis-dev | |
| - name: Configure CMake | |
| run: cmake src | |
| - name: Compile | |
| run: make | |
| - name: Run Tests | |
| run: ctest --output-on-failure | |
| # 3. C++ Indexer Native Build | |
| # Compiles the indexer directly on the runner to catch syntax/linker errors fast. | |
| indexer-build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./cpp/indexer | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake libpqxx-dev libhiredis-dev librocksdb-dev libgumbo-dev zlib1g-dev | |
| - name: Create Build Directory | |
| run: mkdir -p build | |
| - name: Configure CMake | |
| run: cmake ../src | |
| working-directory: ./cpp/indexer/build | |
| - name: Compile | |
| run: make | |
| working-directory: ./cpp/indexer/build | |
| - name: Run Tests | |
| run: ctest --output-on-failure | |
| working-directory: ./cpp/indexer/build | |
| # 3. Rails API Checks | |
| # Runs linting and security scans for the Rails API. | |
| rails-checks: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./API | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4' | |
| bundler-cache: true | |
| - name: Security Scan (Brakeman) | |
| # Only run if brakeman is in Gemfile, otherwise skip or install it | |
| run: | | |
| if bundle show brakeman; then | |
| bundle exec brakeman --no-pager | |
| else | |
| echo "Brakeman not found, skipping." | |
| fi | |
| - name: Lint (Rubocop) | |
| # Only run if rubocop is in Gemfile | |
| run: | | |
| if bundle show rubocop; then | |
| bundle exec rubocop | |
| else | |
| echo "Rubocop not found, skipping." | |
| fi | |
| # 4. Python Ranker Checks | |
| # Basic syntax check for the Python service. | |
| ranker-checks: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./python/ranker | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| cache: 'pip' | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y librocksdb-dev zlib1g-dev libbz2-dev liblz4-dev libsnappy-dev libzstd-dev | |
| - name: Install Dependencies | |
| run: | | |
| pip install "Cython<3.0" setuptools wheel | |
| pip install --no-build-isolation -r requirements.txt | |
| - name: Syntax Check | |
| run: python -m compileall . | |
| # 5. Publish Images (CD - Placeholder) | |
| # Pushes images to GitHub Container Registry on merge to main. | |
| # publish-images: | |
| # needs: [docker-build, crawler-build, rails-checks, ranker-check] | |
| # runs-on: ubuntu-latest | |
| # if: github.ref == 'refs/heads/main' | |
| # permissions: | |
| # packages: write | |
| # contents: read | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - name: Log in to the Container registry | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: ghcr.io | |
| # username: ${{ github.actor }} | |
| # password: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Build and push | |
| # run: | | |
| # docker compose build | |
| # docker compose push |