Skip to content

⚙️ CI/CD Integration (GitHub Actions)

Alnoms acts as a strict deployment gatekeeper for your platform team. By integrating the Alnoms engine into your CI pipeline, you can automatically block pull requests that introduce catastrophic algorithmic regressions (\(O(N^2)\), \(O(N^3)\)) into your master branch.

Quickstart Setup

Create a new file in your repository at .github/workflows/alnoms.yml and paste the following configuration:

name: Alnoms Cost Intelligence Guardrail

on:
  pull_request:
    paths:
      - '**.py' # Only trigger when Python files are changed

# REQUIRED: Allow Alnoms to post the report to the Pull Request
permissions:
  contents: read
  pull-requests: write

jobs:
  performance-audit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0 # Required for Alnoms to perform git diff

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install Alnoms Engine
        run: pip install alnoms

      - name: Run Alnoms Guardrail
        uses: arpraxadmin/alnoms-action@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FAIL_ON: 'O(N^2)'

How it Works

When a developer opens a Pull Request, Alnoms will statically scan the modified files. If it detects severe algorithmic inefficiencies (like nested loops causing quadratic time complexity), it will fail the build and post actionable diagnostics, preventing the merge until the performance bottleneck is resolved.