name: Build and Test RAG Assistant # This workflow triggers automatically whenever you push code to GitHub on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: name: Build on ${{ matrix.os }} with Python ${{ matrix.python-version }} # --- THE MATRIX STRATEGY --- # This spins up 4 separate cloud computers simultaneously: # (Ubuntu + Py3.10), (Ubuntu + Py3.11), (Windows + Py3.10), (Windows + Py3.11) strategy: matrix: os: [ubuntu-latest, windows-latest] python-version: ["3.10", "3.11"] runs-on: ${{ matrix.os }} steps: # Step 1: Download your code onto the cloud computer - name: Checkout Code uses: actions/checkout@v4 # Step 2: Install the specific Python version from the matrix - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' # Speeds up future builds # Step 3: Install all your required Python packages - name: Install dependencies run: | python -m pip install --upgrade pip pip install pytest pybind11 scikit-build-core ninja pip install -r requirements.txt # Step 4: Compile the C++ extension just like you did locally! - name: Compile C++ Tokenizer run: pip install ./src/fast_tokenizer # Step 5: Run your pytest suite to ensure the agent logic works - name: Run Unit Tests run: pytest test_agent.py -v