Section 5/171 menit

5. Workflows — Inti Xcode Cloud

5. Workflows — Inti Xcode Cloud

Anatomi Workflow

Setiap workflow terdiri dari:

swift
Workflow
├── Name             — identifikasi human-readable
├── Environment      — Xcode version, macOS version
├── Start Conditions — kapan workflow mulai (push, PR, schedule, manual)
├── Actions          — apa yang dikerjakan (Build, Test, Analyze, Archive)
└── Post-Actions     — apa yang dilakukan setelah actions selesai

Contoh Strategi Multi-Workflow

Tim biasanya membuat beberapa workflow untuk siklus development yang berbeda:

swift
Workflow 1: "PR Validation"
├── Start Condition: Pull Request dibuat/diupdate ke branch main/develop
├── Actions: Build + Test (semua test suite)
└── Post-Action: Notify (Slack #ios-ci)

Workflow 2: "Develop Deploy"
├── Start Condition: Push ke branch develop
├── Actions: Build + Test + Archive
└── Post-Action: TestFlight Internal Testing + Notify

Workflow 3: "Release"
├── Start Condition: Tag yang match pattern "v*.*.*"
├── Actions: Build + Test + Archive (Release config)
└── Post-Action: TestFlight External Testing + Notify

Workflow 4: "Nightly"
├── Start Condition: Schedule — setiap hari jam 02:00
├── Actions: Build + Test + Analyze
└── Post-Action: Notify (hanya jika gagal)

Konfigurasi Environment

swift
Environment Settings:
├── Xcode Version
│   ├── Latest Release (direkomendasikan untuk production)
│   ├── Latest Beta (untuk testing kompatibilitas)
│   └── Specific Version (misal: Xcode 16.2)
└── Clean Build
    ├── Always (paling reliable, lebih lambat)
    └── Only on new branch/tag start condition (lebih cepat)