Using AI for CI & Automation in iOS Projects

Nov 11 2026 · Swift 5, iOS 27, Xcode 27

Lesson 02: Comparative Evaluation of AI Review Tools in CI

Demo

Episode complete

Play next episode

Next

Written by the author, AI-editedAI-generated, author-verified How this module was made

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In the previous lesson we added a GitHub Copilot-based agentic review that runs automatically on every pull request. Today we extend that foundation by placing the identical change set in front of two additional agents—Claude Code and OpenAI Codex—so that we can compare quality, latency and token count under controlled conditions. We begin from the same sample iOS repository. The Starter folder of this lesson is again the root of the repository and has been committed as the main branch so that GitHub Actions can discover the new workflow files. It already contains the Lesson 1 Copilot workflow, CODE_REVIEW.md, CI_GUIDANCE.md, and the shared helpers under resources/.github/scripts/. Token accounting for all three agents is kept consistent through those helpers—we will call them from the workflows rather than pasting their bodies into the YAML. The scripts stay unchanged; each new workflow reuses the same CI_GUIDANCE parameter.

name: Claude Code Review
on:
  pull_request:
env:
  CI_GUIDANCE: CI_GUIDANCE.md
jobs:
  claude-review:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout repository
        uses: actions/checkout@v7
        with:
          fetch-depth: 0
      - name: Build review prompt
        id: prompt
        run: |
          {
            echo 'text<<PROMPT_EOF'
            ./.github/scripts/build-review-prompt.sh claude \
              "${{ github.base_ref }}" \
              "${{ github.repository }}" \
              "${{ github.event.pull_request.number }}" \
              --guidance "${{ env.CI_GUIDANCE }}"
            echo 'PROMPT_EOF'
          } >> "$GITHUB_OUTPUT"
      - name: Run Claude Code review
        id: claude
        uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          # Use the workflow GITHUB_TOKEN so we do not require the Claude Code
          # GitHub App (OIDC app-token exchange). Comments are posted below
          # with the same token.
          github_token: ${{ secrets.GITHUB_TOKEN }}
          prompt: ${{ steps.prompt.outputs.text }}
          claude_args: |
            --model claude-sonnet-5
            --max-turns 20
            --allowedTools "Read,Glob,Grep,Bash(git *)"
      - name: Print token usage
        if: always() && steps.claude.outputs.execution_file != ''
        run: ./.github/scripts/claude-token-usage.sh "${{ steps.claude.outputs.execution_file }}"
      - name: Extract review text
        if: success() && steps.claude.outputs.execution_file != ''
        run: |
          jq -r '
            [.[] | select(.type == "result" and .subtype == "success")]
            | last
            | .result // empty
          ' "${{ steps.claude.outputs.execution_file }}" > claude-review.md
          if [ ! -s claude-review.md ]; then
            echo "No review text found in Claude execution result." >&2
          fi
      - name: Post review comment
        if: success()
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
        run: ./.github/scripts/post-review-comment.sh claude-review.md "Claude Code Review"
name: Codex Review
on:
  pull_request:
env:
  CI_GUIDANCE: CI_GUIDANCE.md
jobs:
  codex-review:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout repository
        uses: actions/checkout@v7
        with:
          fetch-depth: 0
      - name: Build review prompt
        run: ./.github/scripts/build-review-prompt.sh codex "${{ github.base_ref }}" --guidance "${{ env.CI_GUIDANCE }}" > review-prompt.txt
      - name: Run Codex review
        id: codex
        uses: openai/codex-action@v1
        with:
          openai-api-key: ${{ secrets.OPENAI_API_KEY }}
          # Pin home so the token-usage step can find session rollouts reliably.
          codex-home: ${{ runner.temp }}/codex-home
          prompt-file: review-prompt.txt
          output-file: codex-review.md
      - name: Print token usage
        if: always()
        run: ./.github/scripts/codex-token-usage.sh "${{ runner.temp }}/codex-home"
      - name: Post review comment
        if: success()
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
        run: ./.github/scripts/post-review-comment.sh codex-review.md "Codex Review"
See forum comments
Cinema mode Download course materials from Github
Previous: Comparing Review Agents Next: Conclusion