# ACDL Primitives Plan Pipeline — GitHub Actions (production)
#
# Runs on PRs to main. For each L1 primitive, runs a plan-only (offline
# --check-only mode: resolves the primitive's instance.json, runs the adapter,
# validates the emitted Terraform structure).
name: acdl-primitives-plan

on:
  pull_request:
    branches: [main]

jobs:
  primitive-plan:
    name: Primitive plan (${{ matrix.primitive }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        primitive: [s3, vpc, ecs-cluster, ecs-service, iam-role, alb, ecr, cloudfront, waf, rds]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Install dependencies
        run: pip install jsonschema pyyaml boto3
      - name: Primitive plan check (${{ matrix.primitive }})
        run: bash scripts/run_primitive_plan.sh --check-only ${{ matrix.primitive }}