Skip to content

Latest commit

 

History

History
77 lines (67 loc) · 2.2 KB

ios-pull-request-workflow.md

File metadata and controls

77 lines (67 loc) · 2.2 KB

(iOS) Example Pull Request Workflow

Description

Example Workflow for iOS Pull Request validation. The Workflow contains:

  1. Installing Cocoapods and Carthage dependecies.
  2. Running all unit and UI tests on simulator
  3. Building a test app and uploading to bitrise.io
  4. Sending the QR code of the test build to the Pull Request
  5. Triggering the workflow for Pull Requests.

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:
  pull-request:
    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
    - deploy-to-bitrise-io@2: {}
    - create-install-page-qr-code@1: {}
    - comment-on-github-pull-request@0:
        inputs:
        - body: |-
            ![QR code]($BITRISE_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL)

            $BITRISE_PUBLIC_INSTALL_PAGE_URL
        - personal_access_token: $GITHUB_ACCESS_TOKEN
    - save-carthage-cache@1: {}
    - save-cocoapods-cache@1: {}
    - save-spm-cache@1: {}

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

trigger_map:
- pull_request_source_branch: "*"
  workflow: pull-request