Skip to content

Latest commit

 

History

History
72 lines (63 loc) · 1.94 KB

ios-ci-workflow.md

File metadata and controls

72 lines (63 loc) · 1.94 KB

(iOS) Example CI Workflow

Description

Example Workflow for commits on the main branch of an iOS app. The Workflow contains:

  1. Installing Cocoapods and Carthage dependecies.
  2. Running all unit and UI tests in simulator
  3. Building a test app and uploading to bitrise.io
  4. Sending a Slack notification with the build status

bitrise.yml

---
format_version: '17'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: ios

meta:
  bitrise.io:
    stack: osx-xcode-16.0.x
    machine_type_id: g2.mac.medium

workflows:
  ci:
    steps:
    - activate-ssh-key@4:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@8: {}
    - restore-cocoapods-cache@2: {}
    - cocoapods-install@2: {}
    - restore-carthage-cache@2: {}
    - carthage@3:
        inputs:
        - carthage_options: "--use-xcframeworks --platform iOS"
    - restore-spm-cache@2: {}
    - xcode-test@5:
        inputs:
        - log_formatter: xcodebuild
        - xcodebuild_options: "-enableCodeCoverage YES"
    - xcode-archive@5:
        inputs:
        - project_path: $BITRISE_PROJECT_PATH
        - scheme: $BITRISE_SCHEME
        - automatic_code_signing: apple-id
        - distribution_method: development
    - save-spm-cache@1: {}
    - save-carthage-cache@1: {}
    - save-cocoapods-cache@1: {}
    - deploy-to-bitrise-io@2: {}
    - slack@4:
        inputs:
        - channel: "#build-notifications"
        - webhook_url: $SLACK_WEBHOOK

app:
  envs:
  - BITRISE_PROJECT_PATH: BitriseTest.xcworkspace
    opts:
      is_expand: false
  - BITRISE_SCHEME: BitriseTest
    opts:
      is_expand: false
  - BITRISE_DISTRIBUTION_METHOD: development
    opts:
      is_expand: false

trigger_map:
- push_branch: main
  workflow: ci