# Level 4: CI/CD Workflow
# Demonstrates CI/CD integration for large projects

name: CI/CD Pipeline

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup Rust
        uses: actions-rs/toolchain@v1
      - name: Generate Code
        run: |
          ggen lifecycle run generate
      - name: Build
        run: |
          cd generated && cargo build --workspace

  test:
    runs-on: ubuntu-latest
    needs: generate
    steps:
      - uses: actions/checkout@v3
      - name: Setup Rust
        uses: actions-rs/toolchain@v1
      - name: Run Tests
        run: |
          cd generated && cargo test --workspace

