Share the app state (e.g source directory with installed libraries) between multiple workflows

ios
#1

I set up multiple workflows running in parallel for tests and archiving using Start Build/Wait for Build steps. After both finish, the build is sent to the App Store Connect. The problem is that I have duplicate steps in both workflows such as Activate SSH, Clone Repo, Cache Pull, Bundle Install, Pods Install, Cache Push, Install Certificates, etc. I want to start one workflow which does these steps and then the other one which continues from that state. I tried to do by rearranging Start Build/Wait for Build steps but I got .workspace doesn’t exist error. Any ideas?

0 Likes

#2

Hi @sukhrob_khakimov,

Thank you for reaching out.

Can you please share links to your build(s) in question and a copy of your bitrise.yml?

Thanks and looking forward to hearing from you.

Kind regards,
Luna

0 Likes

#3

Please follow-up with the previously requested information. Otherwise in 5 business days I will close the topic. Thanks!

0 Likes

#5

Hi. Here is bitrise.yml file

---
format_version: '5'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: fastlane
app:
  envs:
  - opts:
      is_expand: false
    FASTLANE_WORK_DIR: "."
  - FASTLANE_XCODE_LIST_TIMEOUT: '120'
  - FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: '30'
  - BITRISE_PROJECT_PATH: MySuperDispatch.xcworkspace
  - BITRISE_SCHEME: MySuperDispatch
  - DEVELOPER_PORTAL_TEAM_ID: T2D46R427K
trigger_map:
- push_branch: master
  workflow: release
- pull_request_source_branch: "*"
  pull_request_target_branch: master
  workflow: testing
workflows:
  release:
    steps:
    - build-router-start@0.11.3:
        inputs:
        - environment_key_list: ''
        - access_token: "$BITRISE_ACCESS_TOKEN"
        - workflows: testing
    - activate-ssh-key@4.0.5:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@4.0.18: {}
    - cache-pull@2.1.3: {}
    - bitrise-step-install-bundler@1.1.2: {}
    - cocoapods-install@1.10.1: {}
    - script@1.1.6:
        title: Install SPM Dependencies
        inputs:
        - content: |-
            #!/usr/bin/env bash
            # fail if any commands fails
            set -e
            # debug log
            set -x

            # Workaround to install SPM packages
            for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts
            xcodebuild -resolvePackageDependencies

            # or run a script from your repository, like:
            # bash ./path/to/script.sh
            # not just bash, e.g.:
            # ruby ./path/to/script.rb
    - cache-push@2.2.3: {}
    - certificate-and-profile-installer@1.10.2: {}
    - fastlane@2.7.0:
        inputs:
        - lane: "$FASTLANE_LANE"
        - work_dir: "$FASTLANE_WORK_DIR"
        title: Increment Build Number
    - xcode-archive@2.7.1:
        inputs:
        - export_method: app-store
        - upload_bitcode: 'no'
        - team_id: "$DEVELOPER_PORTAL_TEAM_ID"
        - configuration: Release
    - build-router-wait@0.9.2:
        inputs:
        - access_token: "$BITRISE_ACCESS_TOKEN"
    - deploy-to-itunesconnect-application-loader@0.10.1:
        inputs:
        - password: "$APPLE_ID_PASSWORD"
        - itunescon_user: "$APPLE_ID"
    - slack@3.1.3:
        inputs:
        - api_token: ''
        - webhook_url: "$SLACK_URL"
        - channel: "$SLACK_CHANNEL"
    envs:
    - opts:
        is_expand: false
      FASTLANE_LANE: release
  testing:
    steps:
    - activate-ssh-key@4.0.5:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@4.0.18: {}
    - cache-pull@2.1.3: {}
    - bitrise-step-install-bundler@1.1.2: {}
    - cocoapods-install@1.10.1: {}
    - script@1.1.6:
        title: Install SPM Dependencies
        inputs:
        - content: |-
            #!/usr/bin/env bash
            # fail if any commands fails
            set -e
            # debug log
            set -x

            # Workaround to install SPM packages
            for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts
            xcodebuild -resolvePackageDependencies

            # or run a script from your repository, like:
            # bash ./path/to/script.sh
            # not just bash, e.g.:
            # ruby ./path/to/script.rb
    - cache-push@2.2.3: {}
    - certificate-and-profile-installer@1.10.2: {}
    - script@1.1.6:
        inputs:
        - content: |-
            #!/usr/bin/env bash
            # fail if any commands fails
            set -e
            # debug log
            set -x

            defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false

            # or run a script from your repository, like:
            # bash ./path/to/script.sh
            # not just bash, e.g.:
            # ruby ./path/to/script.rb
        title: Disable Hardware Keyboard
    - xcode-test@2.4.3:
        inputs:
        - headless_mode: 'no'
        - generate_code_coverage_files: 'yes'
    - deploy-to-bitrise-io@1.9.5: {}
    - slack@3.1.3:
        inputs:
        - channel: "#ios-ci-cd"
        - text: ''
        - emoji: ":muscle:"
        - webhook_url: "$SLACK_URL"
    envs:
    - opts:
        is_expand: false
      FASTLANE_LANE: testing
meta:
  bitrise.io:
    machine_type: performance

Here are the builds:
workflow: testing, build: https://app.bitrise.io/build/8532954894d0020e#?tab=log
workflow: release, build: https://app.bitrise.io/build/ef60096de41ab532#?tab=log

0 Likes

closed #6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

0 Likes