Revision control

Copy as Markdown

format_version: '8'
project_type: ios
pipelines:
pipeline_build_and_test:
workflows:
determine_apps_affected: {}
firefox_configure_build:
run_if:
expression: '{{ enveq "BUILD_FIREFOX_IOS" "true" }}'
depends_on:
- determine_apps_affected
focus_configure_build:
run_if:
expression: '{{ enveq "BUILD_FOCUS_IOS" "true" }}'
depends_on:
- determine_apps_affected
# We don't build klar for new PR now, bu we can still
# start klar_configure_build manually.
klar_configure_build:
run_if:
expression: false
depends_on:
- determine_apps_affected
run_firefox_ui_tests:
run_if:
expression: '{{ enveq "RUN_UI_TESTS" "Run_UI_Tests" }}'
depends_on:
- firefox_configure_build
parallel: 5
focus_ui_test:
run_if:
expression: '{{ enveq "RUN_UI_TESTS" "Run_UI_Tests" }}'
depends_on:
- focus_configure_build
parallel: 1
pipeline_build_and_test_focus:
workflows:
focus_configure_build: {}
focus_ui_test:
depends_on:
- focus_configure_build
parallel: 1
pipeline_build_and_test_release:
workflows:
firefox_scheme_build_for_test: {}
firefox_beta_scheme_build_for_test: {}
run_firefox_scheme_ui_tests:
depends_on:
- firefox_scheme_build_for_test
parallel: 5
run_firefox_beta_scheme_ui_tests:
depends_on:
- firefox_beta_scheme_build_for_test
parallel: 5
pipeline_firefox_fullfunctional_iphone:
workflows:
firefox_fullfunctional_iphone_build: {}
firefox_fullfunctional_iphone_shard:
depends_on:
- firefox_fullfunctional_iphone_build
parallel: 4
firefox_fullfunctional_iphone_report:
depends_on:
- firefox_fullfunctional_iphone_shard
should_always_run: workflow
workflows:
firefox_accessibility_test:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- restore-spm-cache@3:
is_always_run: true
- script@1:
title: Build for Testing
inputs:
- content: |
set -euxo pipefail
echo "-- build-for-testing --"
mkdir DerivedData
xcrun simctl list
xcodebuild -resolvePackageDependencies -onlyUsePackageVersionsFromResolvedFile
xcodebuild "-project" "/Users/vagrant/git/firefox-ios/Client.xcodeproj" "-scheme" "Fennec" -configuration "Debug" "CODE_SIGNING_ALLOWED=NO" -sdk "iphonesimulator" "-destination" "platform=iOS Simulator,name=iPhone 17,OS=26.5" "COMPILER_INDEX_STORE_ENABLE=NO" "build-for-testing" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -derivedDataPath "/Users/vagrant/git/DerivedData" -skipMacroValidation | xcpretty | tee xcodebuild_fennec.log
ls /Users/vagrant/git/DerivedData/Build/Products
ls /Users/vagrant/git/DerivedData
- xcode-test-without-building@0:
continue_on_fail: true
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- xctestrun: "/Users/vagrant/git/DerivedData/Build/Products/Fennec_AccessibilityTestPlan_iphonesimulator26.5-arm64.xctestrun"
- maximum_test_repetitions: 2
- script@1:
title: Count failed tests
is_always_run: true
inputs:
- content: |
echo "Analyzing test results from: $BITRISE_XCRESULT_PATH"
xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json > result.json --legacy
echo "Search for failed tests..."
FAILED_COUNT=$(jq -r '.metrics.testsFailedCount._value' result.json)
echo "Total number of failures: $FAILED_COUNT"
envman add --key ACCESSIBILITY_FAILED_TEST_COUNT --value "$FAILED_COUNT"
- script@1:
title: Collect All Accessibility Report Files
is_always_run: true
inputs:
- content: |
echo "🔍 Search reports inside the device sandbox..."
mkdir -p "$BITRISE_DEPLOY_DIR"
find ~/Library/Developer/CoreSimulator/Devices -type f -name "AccessibilityReport*.txt" -exec cp {} "$BITRISE_DEPLOY_DIR" \;
find ~/Library/Developer/CoreSimulator/Devices -type f -name "AccessibilityReport*.csv" -exec cp {} "$BITRISE_DEPLOY_DIR" \;
echo "Files copied to $BITRISE_DEPLOY_DIR:"
ls -lh "$BITRISE_DEPLOY_DIR"
- deploy-to-bitrise-io@2:
is_always_run: true
- slack@4:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- pretext_on_error: "*Firefox-iOS* :firefox: *Accessibility Tests* :x:"
- pretext: "*Firefox-iOS* :firefox: *Accessibility Tests* :white_check_mark:"
- timestamp: 'no'
- fields: |
Task | ${BITRISE_BUILD_URL}
Number of A11y Failures | ${ACCESSIBILITY_FAILED_TEST_COUNT}
Failures Report | ${BITRISE_BUILD_URL}
Accessibility Reports | ${BITRISE_BUILD_URL}?tab=artifacts
- buttons: |
App|${BITRISE_APP_URL}
Mana|https://mana.mozilla.org/wiki/display/MTE/Mobile+Test+Engineering
firefox_configure_build:
before_run:
- 0_detect_standalone_build
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
- decision_to_run_UI_Tests
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- restore-spm-cache@3:
is_always_run: true
- activate-build-cache-for-xcode@0: {}
- xcode-build-for-test@3:
inputs:
- scheme: Fennec
- configuration: Debug
- project_path: /Users/vagrant/git/firefox-ios/Client.xcodeproj
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" -allowProvisioningUpdates -skipMacroValidation DEVELOPMENT_TEAM=$APPLE_TEAM_ID'
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- script@1:
title: Detect number of warnings
# TODO: Fix the number of warnings reported by Xcode 27
is_always_run: true
inputs:
- content: |
set -e
set -x
echo "bitrise_xcode"
COUNT_XCUI=$(./test-fixtures/generate-metrics.sh $BITRISE_XCODE_RAW_RESULT_TEXT_PATH all)
envman add --key SHOW_WARNING_IN_SLACK --value Show_Warnings
envman add --key SHOW_WARNING_COUNT_XCUI --value "$COUNT_XCUI"
STR=$COUNT_XCUI
SUB='greater'
if [[ "$STR" == *"$SUB"* ]]; then
echo "Failure, the number of warnings increased"
exit 1
fi
- script@1:
title: Remove cache
is_always_run: true
inputs:
- content: |
export PATH="${PATH#"$HOME/.bitrise-xcelerate/bin:"}"
envman add --key PATH --value "$PATH"
- script@1:
title: Override xctestrun file to UnitTests
inputs:
- content: |-
#!/usr/bin/env bash
set -euxo pipefail
# Point to the Unit tests plan instead of Accessibility
UNIT_TESTS_XCTESTRUN="$BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator27.1-arm64.xctestrun"
SMOKE_UI_XCTESTRUN="$BITRISE_TEST_BUNDLE_PATH/Fennec_Smoketest_iphonesimulator27.1-arm64.xctestrun"
if [ ! -f "$UNIT_TESTS_XCTESTRUN" ]; then
echo "ERROR: .xctestrun file not found: $UNIT_TESTS_XCTESTRUN"
exit 1
fi
echo "Found UnitTest .xctestrun: $UNIT_TESTS_XCTESTRUN"
envman add --key BITRISE_XCTESTRUN_UNIT_TEST_FILE_PATH --value "$UNIT_TESTS_XCTESTRUN"
envman add --key BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH --value "$SMOKE_UI_XCTESTRUN"
- xcode-test-without-building@0:
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator27.1-arm64.xctestrun
- maximum_test_repetitions: 2
- test_repetition_mode: retry_on_failure
- xcode-test-shard-calculation@0:
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- product_path: $BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
- shard_count: 5
- destination: $BITRISE_DESTINATION
outputs:
- BITRISE_TEST_SHARDS_PATH: BITRISE_TEST_SHARDS_PATH_FIREFOX
is_always_run: true
# Only push/release/epic builds save SPM cache. PRs read from the cache
# (via restore-spm-cache@3 above) but never write back, so they can't
# poison the cache for subsequent builds. main keeps the cache fresh.
- save-spm-cache@1:
is_always_run: true
run_if: '{{not .IsPR}}'
- script@1:
title: Clean before deploying
timeout: 360
inputs:
- content: |
#!/usr/bin/env bash
set -euo pipefail
echo "Removing raw-xcodebuild-output.log to reduce artifact size"
rm -f "$BITRISE_DEPLOY_DIR/raw-xcodebuild-output.log"
echo "Removing swiftlint reports already deployed by the swiftlint workflow"
rm -f "$BITRISE_DEPLOY_DIR/swiftlint_report.txt" || true
rm -f "$BITRISE_DEPLOY_DIR/swiftlint_report.xml" || true
echo "Removing unit test xcresult"
rm -f "$BITRISE_DEPLOY_DIR"/Test-Fennec_UnitTest_*.xcresult.zip || true
echo "Removing testbundle.zip artifact (already available as pipeline intermediate)"
rm -f "$BITRISE_DEPLOY_DIR/testbundle.zip" || true
echo "Removing dSYM directories from test bundle to reduce pipeline artifact size"
find "$BITRISE_TEST_BUNDLE_PATH" -name "*.dSYM" -type d -exec rm -rf {} + 2>/dev/null || true
echo "Removing .bcsymbolmap files from test bundle"
find "$BITRISE_TEST_BUNDLE_PATH" -name "*.bcsymbolmap" -delete 2>/dev/null || true
- deploy-to-bitrise-io@2:
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- pipeline_intermediate_files: |-
BITRISE_TEST_SHARDS_PATH_FIREFOX
BITRISE_TEST_BUNDLE_PATH
BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
is_always_run: true
- script@1:
title: Run Danger 2
timeout: 360
inputs:
- content: |
#!/usr/bin/env bash
# Fail if any command fails
set -e
# Extract .xcresult using xcrun xccov
echo "Generating coverage.json from xcresult..."
xcrun xccov view --report --json "$BITRISE_XCRESULT_PATH" > coverage.json
echo "coverage.json created successfully"
# Define a cleanup function to remove the file
function cleanup_coverage {
if [ -f coverage.json ]; then
echo "Removing coverage.json"
rm coverage.json
fi
}
# Register it to run on script exit
trap cleanup_coverage EXIT
echo "Running Danger"
swift run danger-swift ci
- slack@4:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- pretext_on_error: "*Firefox-iOS* :firefox: *Build/XCUITests* :x:"
- pretext: "*Firefox-iOS* :firefox: *Build/XCUITests* :white_check_mark:"
- timestamp: 'no'
- fields: |
Task | ${BITRISE_BUILD_URL}
Owner | ${GIT_CLONE_COMMIT_AUTHOR_NAME}
Commit | ${GIT_CLONE_COMMIT_MESSAGE_SUBJECT}
Source-Workflow | ${BITRISE_TRIGGERED_WORKFLOW_TITLE}
Branch | ${BITRISE_GIT_BRANCH}
Warnings-in-code-test | ${SHOW_WARNING_COUNT_XCUI}
- buttons: |
App|${BITRISE_APP_URL}
Mana|https://mana.mozilla.org/wiki/display/MTE/Mobile+Test+Engineering
- slack@4:
is_always_run: true
run_if: '{{getenv "NEW_RC_VERSION" | eq "New_RC_Version" | and .IsBuildFailed}}'
inputs:
- channel: "#firefox-ios"
- text: Build status using latest Rust-Component
- webhook_url: $WEBHOOK_SLACK_TOKEN_2
run_firefox_ui_tests:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
# - skip_macro_validation # TODO check if Needed here?
steps:
- pull-intermediate-files@1: {}
- xcode-test-without-building@0:
timeout: 1200
inputs:
- only_testing: $BITRISE_TEST_SHARDS_PATH_FIREFOX/$BITRISE_IO_PARALLEL_INDEX
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" -collect-test-diagnostics never'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Fennec_Smoketest_iphonesimulator27.1-arm64.xctestrun
- deploy-to-bitrise-io@2: {}
firefox_scheme_build_for_test:
description: Build Firefox scheme and shard XCUITests for parallel execution
before_run:
- skip_macro_validation
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- certificate-and-profile-installer@1: {}
- restore-spm-cache@3:
is_always_run: true
- script@1:
title: Run bootstrap
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
- xcode-build-for-test@3:
inputs:
- scheme: Firefox
- configuration: Firefox
- project_path: /Users/vagrant/git/firefox-ios/Client.xcodeproj
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" -allowProvisioningUpdates -skipMacroValidation DEVELOPMENT_TEAM=$APPLE_TEAM_ID EXCLUDED_SOURCE_FILE_NAMES=""'
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- script@1:
title: Find Smoketest xctestrun file
inputs:
- content: |-
#!/usr/bin/env bash
set -euxo pipefail
echo "Listing all .xctestrun files in $BITRISE_TEST_BUNDLE_PATH"
ls -la "$BITRISE_TEST_BUNDLE_PATH"
# Find the Smoketest xctestrun file (handles any architecture suffix)
SMOKE_UI_XCTESTRUN=$(find "$BITRISE_TEST_BUNDLE_PATH" -name "Firefox_Smoketest_*.xctestrun" | head -n 1)
if [ -z "$SMOKE_UI_XCTESTRUN" ] || [ ! -f "$SMOKE_UI_XCTESTRUN" ]; then
echo "ERROR: Smoketest .xctestrun file not found"
exit 1
fi
echo "Found Smoketest .xctestrun: $SMOKE_UI_XCTESTRUN"
envman add --key BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH --value "$SMOKE_UI_XCTESTRUN"
- xcode-test-shard-calculation@0:
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- product_path: $BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
- shard_count: 5
- destination: $BITRISE_DESTINATION
outputs:
- BITRISE_TEST_SHARDS_PATH: BITRISE_TEST_SHARDS_PATH_FIREFOX_SCHEME
is_always_run: true
- deploy-to-bitrise-io@2:
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- pipeline_intermediate_files: |-
BITRISE_TEST_SHARDS_PATH_FIREFOX_SCHEME
BITRISE_TEST_BUNDLE_PATH
BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
is_always_run: true
run_firefox_scheme_ui_tests:
description: Run Firefox scheme XCUITests in parallel
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
# - skip_macro_validation # TODO check if needed here
steps:
- pull-intermediate-files@1: {}
- xcode-test-without-building@0:
inputs:
- only_testing: $BITRISE_TEST_SHARDS_PATH_FIREFOX_SCHEME/$BITRISE_IO_PARALLEL_INDEX
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" -collect-test-diagnostics never'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Firefox_Smoketest_iphonesimulator26.5-arm64-x86_64.xctestrun
- deploy-to-bitrise-io@2: {}
firefox_scheme_smoke_tests:
description: Run XCUITests on Firefox scheme (non-parallelized, for standalone use)
before_run:
- firefox_scheme_build_for_test
steps:
- pull-intermediate-files@1: {}
- xcode-test-without-building@0:
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- xctestrun: $BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
- maximum_test_repetitions: 2
- deploy-to-bitrise-io@2: {}
- slack@4:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "Firefox scheme XCUITests failed on build $BITRISE_BUILD_NUMBER"
- webhook_url: "$SLACK_WEBHOOK"
firefox_beta_scheme_build_for_test:
description: Build FirefoxBeta scheme and shard XCUITests for parallel execution
before_run:
- skip_macro_validation
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- certificate-and-profile-installer@1: {}
- restore-spm-cache@3:
is_always_run: true
- script@1:
title: Run bootstrap
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
- xcode-build-for-test@3:
inputs:
- scheme: FirefoxBeta
- configuration: FirefoxBeta
- project_path: /Users/vagrant/git/firefox-ios/Client.xcodeproj
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" -allowProvisioningUpdates -skipMacroValidation DEVELOPMENT_TEAM=$APPLE_TEAM_ID EXCLUDED_SOURCE_FILE_NAMES=""'
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- script@1:
title: Find Smoketest xctestrun file
inputs:
- content: |-
#!/usr/bin/env bash
set -euxo pipefail
echo "Listing all .xctestrun files in $BITRISE_TEST_BUNDLE_PATH"
ls -la "$BITRISE_TEST_BUNDLE_PATH"
# Find the Smoketest xctestrun file (handles any architecture suffix)
SMOKE_UI_XCTESTRUN=$(find "$BITRISE_TEST_BUNDLE_PATH" -name "FirefoxBeta_Smoketest_*.xctestrun" | head -n 1)
if [ -z "$SMOKE_UI_XCTESTRUN" ] || [ ! -f "$SMOKE_UI_XCTESTRUN" ]; then
echo "ERROR: Smoketest .xctestrun file not found"
exit 1
fi
echo "Found Smoketest .xctestrun: $SMOKE_UI_XCTESTRUN"
envman add --key BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH --value "$SMOKE_UI_XCTESTRUN"
- xcode-test-shard-calculation@0:
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- product_path: $BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
- shard_count: 5
- destination: $BITRISE_DESTINATION
outputs:
- BITRISE_TEST_SHARDS_PATH: BITRISE_TEST_SHARDS_PATH_FIREFOX_BETA_SCHEME
is_always_run: true
- deploy-to-bitrise-io@2:
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- pipeline_intermediate_files: |-
BITRISE_TEST_SHARDS_PATH_FIREFOX_BETA_SCHEME
BITRISE_TEST_BUNDLE_PATH
BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
is_always_run: true
run_firefox_beta_scheme_ui_tests:
description: Run FirefoxBeta scheme XCUITests in parallel
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
# - skip_macro_validation # TODO test if needed here
steps:
- pull-intermediate-files@1: {}
- xcode-test-without-building@0:
inputs:
- only_testing: $BITRISE_TEST_SHARDS_PATH_FIREFOX_BETA_SCHEME/$BITRISE_IO_PARALLEL_INDEX
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" -collect-test-diagnostics never'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/FirefoxBeta_Smoketest_iphonesimulator26.5-arm64-x86_64.xctestrun
- deploy-to-bitrise-io@2: {}
firefox_beta_scheme_smoke_tests:
description: Run XCUITests on FirefoxBeta scheme (non-parallelized, for standalone use)
before_run:
- firefox_beta_scheme_build_for_test
steps:
- pull-intermediate-files@1: {}
- xcode-test-without-building@0:
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- xctestrun: $BITRISE_XCTESTRUN_SMOKE_TEST_FILE_PATH
- maximum_test_repetitions: 2
- deploy-to-bitrise-io@2: {}
- slack@4:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "FirefoxBeta scheme XCUITests failed on build $BITRISE_BUILD_NUMBER"
- webhook_url: "$SLACK_WEBHOOK"
determine_apps_affected:
steps:
- git-clone@6: {}
- script@1:
title: Determine which application to base configuration
inputs:
- content: |-
#!/usr/bin/env bash
set -e
# Determine which application to base configuration while comparing against branch destination:
#
# BITRISEIO_GIT_BRANCH_DEST is used only on pull requests and is set to destination/branch (i.e, release/v123 )
# BITRISE_GIT_BRANCH is the git branch that is built by Bitrise (i.e, release/v123 )
# BITRISE_GIT_COMMIT is the git commit hash that is built by Bitrise
#
# If the destination branch is a release or epic branch, we need to compare changes against that destination branch
# If the branch built by Bitrise is a release or epic branch, we need to compare changes against that branch
# Otherwise, we need to compare changes against origin/main
if [[ $BITRISEIO_GIT_BRANCH_DEST = release* ]] || [[ $BITRISEIO_GIT_BRANCH_DEST = epic* ]]; then
BASE_BRANCH="$BITRISEIO_GIT_BRANCH_DEST"
echo $BASE_BRANCH
elif [[ $BITRISE_GIT_BRANCH = release* ]] || [[ $BITRISE_GIT_BRANCH = epic* ]]; then
BASE_BRANCH="$BITRISE_GIT_BRANCH"
echo $BASE_BRANCH
else
BASE_BRANCH="origin/main"
echo $BASE_BRANCH
fi
# Determine apps affected by the changes introduced in the commit/PR
APPS_AFFECTED=$(git diff --name-only $BASE_BRANCH..."$BITRISE_GIT_COMMIT" | xargs -n1 dirname | sort | uniq)
echo "These are the files changed:"
echo $APPS_AFFECTED
# Initialize all application flags as "false" by default
BUILD_FIREFOX_IOS="false"
BUILD_FOCUS_IOS="false"
BUILD_SAMPLE_BROWSER_IOS="false"
# Manual triggers leave empty commits.
# Check for empty commit/PR and exit blacklist check if found to avoid erroring out.
echo "Files changed in commit/PR: $APPS_AFFECTED"
if [[ -z "$APPS_AFFECTED" ]]; then
echo "No files changed in commit/PR. Skipping Blacklist check..."
# Set environment variables
envman add --key BUILD_FIREFOX_IOS --value "true"
envman add --key BUILD_FOCUS_IOS --value "true"
exit 0
fi
# Skip building on only markdown, LICENSE, and PR template changes
TOTAL_CHANGED_FILES_COUNT=$(git diff --name-only $BASE_BRANCH..."$BITRISE_GIT_COMMIT" | wc -l | xargs)
DOCS_ONLY_FILE_COUNT=$(git diff --name-only $BASE_BRANCH..."$BITRISE_GIT_COMMIT" \
| grep -Eci '(\.md$|^LICENSE$|^PULL_REQUEST_TEMPLATE$)' | xargs)
if [ "$TOTAL_CHANGED_FILES_COUNT" -eq "$DOCS_ONLY_FILE_COUNT" ] && [ "$DOCS_ONLY_FILE_COUNT" -ne 0 ]; then
echo "Only Markdown, LICENSE or template files have been changed. No build will be triggered."
exit 0
fi
# Check for specific applications and set flags accordingly
# Add more specific conditions for directories as needed; otherwise see default case
# Pattern matches (*) on directory names and reacts to subdirectory changes as well
for app in $APPS_AFFECTED; do
# Check for root directory changes
if [[ "$app" == "." ]]; then
CHANGED_FILES=$(git diff --name-only $BASE_BRANCH..."$BITRISE_GIT_COMMIT")
echo "Project root changes detected: $CHANGED_FILES"
ROOT_SPECIFIC_FILES=$(echo "$CHANGED_FILES" | grep -E '^(bootstrap\.sh|content_blocker_update\.sh|Dangerfile\.swift|Info\.plist|iOSNimbusFeatureUtility\.sh|package\.lock|Package\.json|Package\.resolved|Package\.swift|rust_components_local\.sh|setup_build_tools\.sh|update_version\.sh|\.swiftlint\.yml)$' || true)
echo "Root specific files: $ROOT_SPECIFIC_FILES"
if [ ! -z "$ROOT_SPECIFIC_FILES" ]; then
BUILD_FIREFOX_IOS="true"
fi
fi
case "$app" in
firefox-ios*)
BUILD_FIREFOX_IOS="true"
;;
focus-ios*)
BUILD_FOCUS_IOS="true"
;;
SampleBrowser*)
BUILD_SAMPLE_BROWSER_IOS="true"
;;
BrowserKit*|taskcluster*|test-fixtures*)
# Explicitly directory changes - build all applications
BUILD_FIREFOX_IOS="true"
BUILD_FOCUS_IOS="true"
;;
".")
# Root directory changes - build all applications
BUILD_FIREFOX_IOS="true"
BUILD_FOCUS_IOS="false"
BUILD_SAMPLE_BROWSER_IOS="true"
;;
*)
# Default case - build all applications (e.g, BrowserKit)
BUILD_FIREFOX_IOS="true"
BUILD_FOCUS_IOS="true"
BUILD_SAMPLE_BROWSER_IOS="true"
;;
esac
done
# Set environment variables
envman add --key BUILD_FIREFOX_IOS --value "$BUILD_FIREFOX_IOS"
envman add --key BUILD_FOCUS_IOS --value "$BUILD_FOCUS_IOS"
envman add --key BUILD_SAMPLE_BROWSER_IOS --value "$BUILD_SAMPLE_BROWSER_IOS"
echo "BUILD_FIREFOX_IOS: $BUILD_FIREFOX_IOS"
echo "BUILD_FOCUS_IOS: $BUILD_FOCUS_IOS"
echo "BUILD_SAMPLE_BROWSER_IOS: $BUILD_SAMPLE_BROWSER_IOS"
- share-pipeline-variable@1:
inputs:
- variables: |-
BUILD_FIREFOX_IOS
BUILD_FOCUS_IOS
BUILD_SAMPLE_BROWSER_IOS
- script@1:
title: Echo applications set
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
echo "BUILD_FIREFOX_IOS: $BUILD_FIREFOX_IOS"
echo "BUILD_FOCUS_IOS: $BUILD_FOCUS_IOS"
echo "BUILD_SAMPLE_BROWSER_IOS: $BUILD_SAMPLE_BROWSER_IOS"
send_slack_notification:
steps:
- slack@4:
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- pretext_on_error: "*Firefox-iOS* :firefox: *Build/XCUITests* :x:"
- pretext: "*Firefox-iOS* :firefox: *Build/XCUITests* :white_check_mark:"
- timestamp: 'no'
- fields: |
Task | ${BITRISE_BUILD_URL}
Owner | ${GIT_CLONE_COMMIT_AUTHOR_NAME}
Commit | ${GIT_CLONE_COMMIT_MESSAGE_SUBJECT}
Source-Workflow | ${BITRISE_TRIGGERED_WORKFLOW_TITLE}
Branch | ${BITRISE_GIT_BRANCH}
Warnings-in-code | ${SHOW_WARNING_COUNT}
Warnings-in-code-test | ${SHOW_WARNING_COUNT_XCUI}
- buttons: |
App|${BITRISE_APP_URL}
Mana|https://mana.mozilla.org/wiki/display/MTE/Mobile+Test+Engineering
0_detect_standalone_build:
steps:
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
# ANSI color codes
RED='\033[31;1m'
CYAN='\033[36;1m'
GREEN='\033[32;1m'
NC='\033[0m' # No Color (resets color to default)
# Check if $BITRISEIO_PIPELINE_ID is unset or empty
# If so, this is a standalone build and we need to fail it
if [ -z "$BITRISEIO_PIPELINE_ID" ]; then
printf "\n${RED}Error: BITRISEIO_PIPELINE_ID is not set.${NC}\n\
This means you have triggered a build stage or workflow individually, instead of the entire pipeline.\n\n\
The current build workflow is: ${RED}$BITRISE_TRIGGERED_WORKFLOW_TITLE${NC}, but needs to be run in ${RED}pipeline_build_and_test${NC}.\n\n\
To trigger a pipeline rebuild in its entirety, please do the following:\n\n\
${CYAN}1. Select your last failed build for 'pipeline_build_and_test'.\n\
${CYAN}2. Click the 'Rebuild' button dropdown icon located in the top right of the page.\n\
${CYAN}3. From the dropdown menu, select 'Rebuild entire Pipeline'.\n\
${CYAN}4. If no dropdown menu is present, you are looking at a standalone build\n\
${CYAN}and need to select the initial Github pipeline triggered by the PR.${NC}\n\n\
If you are still having issues, please contact ${GREEN}#mobile-testeng${NC} on Slack.\n"
exit 1 # Exit with a failure status
else
echo "BITRISEIO_PIPELINE_ID is set to $BITRISEIO_PIPELINE_ID"
fi
title: Detect standalone build
firefox_fullfunctional_iphone_build:
description: Build Fennec scheme and shard the full functional tests across 4 VMs
envs:
- FULLFUNCTIONAL_DESTINATION: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
steps:
- restore-spm-cache@3:
is_always_run: true
- activate-build-cache-for-xcode@0: {}
- xcode-build-for-test@3:
title: Build Firefox iOS
inputs:
- scheme: Fennec
- configuration: Debug
- project_path: /Users/vagrant/git/firefox-ios/Client.xcodeproj
- test_plan: FullFunctionalTestPlan
- xcodebuild_options: ONLY_ACTIVE_ARCH=YES COMPILER_INDEX_STORE_ENABLE=NO
- destination: $FULLFUNCTIONAL_DESTINATION
- xcode-test-shard-calculation@0:
inputs:
- product_path: $BITRISE_XCTESTRUN_FILE_PATH
- shard_count: 4
- destination: $FULLFUNCTIONAL_DESTINATION
- deploy-to-bitrise-io@2:
inputs:
- pipeline_intermediate_files: |-
BITRISE_TEST_SHARDS_PATH
BITRISE_TEST_BUNDLE_PATH
firefox_fullfunctional_iphone_shard:
description: Run one shard of the Firefox full functional tests
before_run:
- 1_git_clone_and_post_clone
steps:
- pull-intermediate-files@1: {}
- script@1:
title: Find FullFunctionalTestPlan xctestrun file
inputs:
- content: |-
set -euxo pipefail
XCTESTRUN=$(find "$BITRISE_TEST_BUNDLE_PATH" -name "Fennec_FullFunctionalTestPlan_*.xctestrun" | head -n 1)
envman add --key FULLFUNCTIONAL_XCTESTRUN --value "$XCTESTRUN"
- xcode-test-without-building@0:
title: Run full functional tests shard
inputs:
- only_testing: $BITRISE_TEST_SHARDS_PATH/$BITRISE_IO_PARALLEL_INDEX
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- xctestrun: $FULLFUNCTIONAL_XCTESTRUN
- xcodebuild_options: -collect-test-diagnostics never
- script@1:
title: Count failed tests in this shard
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
if [ -z "$BITRISE_XCRESULT_PATH" ]; then
FAILED_COUNT="no results"
else
FAILED_COUNT=$(xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json --legacy 2>/dev/null | jq -r '.metrics.testsFailedCount._value // 0')
fi
echo "Shard $BITRISE_IO_PARALLEL_INDEX failures: ${FAILED_COUNT:-no results}"
echo "${FAILED_COUNT:-no results}" > "$BITRISE_DEPLOY_DIR/fullfunctional_result.txt"
- deploy-to-bitrise-io@2:
is_always_run: true
inputs:
- pipeline_intermediate_files: $BITRISE_DEPLOY_DIR/fullfunctional_result.txt:FULLFUNCTIONAL_RESULT_$BITRISE_IO_PARALLEL_INDEX
firefox_fullfunctional_iphone_report:
description: Collect the failed test counts from all shards and report them to Slack
envs:
- FULLFUNCTIONAL_SHARD_COUNT: 4
steps:
- pull-intermediate-files@1: {}
- script@1:
title: Sum failed tests across shards
inputs:
- content: |-
#!/usr/bin/env bash
TOTAL=0
DETAILS=""
STATUS=":white_check_mark:"
COLOR="#3bc3a3"
for i in $(seq 0 $((FULLFUNCTIONAL_SHARD_COUNT - 1))); do
RESULT_FILE_VAR="FULLFUNCTIONAL_RESULT_$i"
RESULT_FILE="${!RESULT_FILE_VAR}"
if [ -n "$RESULT_FILE" ] && [ -f "$RESULT_FILE" ]; then
COUNT=$(cat "$RESULT_FILE")
else
COUNT="no results"
fi
if [[ "$COUNT" =~ ^[0-9]+$ ]]; then
TOTAL=$((TOTAL + COUNT))
[ "$COUNT" -gt 0 ] && STATUS=":x:" && COLOR="danger"
else
STATUS=":x:"
COLOR="danger"
fi
DETAILS="${DETAILS}Shard $((i + 1)): ${COUNT}"$'\n'
done
echo "Total failures: $TOTAL"
printf "%b" "$DETAILS"
envman add --key FULLFUNCTIONAL_SLACK_STATUS --value "$STATUS"
envman add --key FULLFUNCTIONAL_SLACK_COLOR --value "$COLOR"
envman add --key FULLFUNCTIONAL_SLACK_MESSAGE --value "Number of failed tests: $TOTAL"
- slack@4:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- pretext: "*Firefox-iOS* :firefox: *Full Functional Tests iPhone* ${FULLFUNCTIONAL_SLACK_STATUS}"
- color: "$FULLFUNCTIONAL_SLACK_COLOR"
- message: "$FULLFUNCTIONAL_SLACK_MESSAGE"
- timestamp: 'no'
- fields: |
Branch | ${BITRISE_GIT_BRANCH}
- buttons: |
Test Results|https://app.bitrise.io/app/${BITRISE_APP_SLUG}/pipelines/${BITRISEIO_PIPELINE_ID}?tab=tests
1_git_clone_and_post_clone:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
BRANCH=$BITRISE_GIT_BRANCH
if [[ $BRANCH == update-spm-new-rust-component-tag-* ]]
then
echo "Building with new Rust-Component version"
envman add --key NEW_RC_VERSION --value New_RC_Version
fi
title: Save Branch Name
- cache-pull@2: {}
2_certificate_and_profile:
steps:
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
cd firefox-ios/Client.xcodeproj
sed -i '' 's/CODE_SIGN_IDENTITY = "iPhone Developer"/CODE_SIGN_IDENTITY = "iPhone Developer"/' project.pbxproj
cd -
title: Set xcodeproj code_sign_identity to iPhone Developer
- script@1:
inputs:
- content: |-
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
title: Run bootstrap
- script@1:
title: Run swiftlint
inputs:
- content: |-
#!/usr/bin/env bash
set -euo pipefail
cd "$BITRISE_SOURCE_DIR"
# Use the version pinned in .swiftlint-version rather than whichever
# version the stack happens to ship, so that CI and local runs match
SWIFTLINT=$(./scripts/install-swiftlint.sh)
"$SWIFTLINT" version
# Lint from the repo root and don't pass a config file, to make use
# of nested configurations. Violations are written to stdout, while
# progress and the summary go to stderr.
REPORT="$BITRISE_DEPLOY_DIR/swiftlint_report.txt"
set +e
"$SWIFTLINT" lint > "$REPORT"
set -e
cat "$REPORT"
# Publish the violations as a test report as well, so that swiftlint
# gets its own entry on the pull request alongside the UI test ones.
# SwiftLint takes a single reporter per run, so this is a second pass
# rather than a second output format; it hits SwiftLint's cache from
# the run above. A run with no violations still writes a test suite,
# which is what keeps the entry visible when linting passes.
if [ -n "${BITRISE_TEST_RESULT_DIR:-}" ]; then
RESULT_DIR="$BITRISE_TEST_RESULT_DIR/swiftlint"
mkdir -p "$RESULT_DIR"
set +e
"$SWIFTLINT" lint --reporter junit > "$RESULT_DIR/swiftlint.xml"
set -e
echo '{"test-name":"swiftlint"}' > "$RESULT_DIR/test-info.json"
else
echo "BITRISE_TEST_RESULT_DIR is unset, skipping the swiftlint test report"
fi
# Left unset when there are no violations, which the next step reads
if [ -s "$REPORT" ]; then
envman add --key SWIFTLINT_REPORT --valuefile "$REPORT"
fi
- deploy-to-bitrise-io@2: {}
- script@1:
inputs:
- content: |-
set -e
echo "$SWIFTLINT_REPORT"
if [ ! -z "$SWIFTLINT_REPORT" ] ;then
# The file is not-empty.
echo "Failing build since there are swiftlint errors"
exit 1
fi
title: Fail build if swiftlint fails
3_provisioning_and_npm_installation:
steps:
- script@1:
title: NPM install and build
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
set -x
npm install
npm run build
skip_macro_validation:
steps:
- script@1:
title: Skip validation for Swift macros and SPM plugins
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
# Skip validation for Swift macros
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
Detect_warnings:
steps:
- script@1:
title: Detect number of warnings
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
TEST_LOG_PATH=$BITRISE_XCODEBUILD_TEST_LOG_PATH
COUNT_XCUI=$(./test-fixtures/generate-metrics.sh $TEST_LOG_PATH all)
envman add --key SHOW_WARNING_COUNT_XCUI --value "$COUNT_XCUI"
envman add --key SHOW_WARNING_IN_SLACK --value Show_Warnings
STR=$COUNT_XCUI
SUB='greater'
if [[ "$STR" == *"$SUB"* ]]; then
echo "Failure, the number of warnings increased"
exit 1
fi
is_always_run: true
decision_to_run_UI_Tests:
steps:
- script@1:
title: Files changed in commit
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
# We need to check both PRs and MERGEs for release and epic branches so an error isn't
# created when trying to find a diff on a commit that doesn't exist on origin/main
# First check destination branch for PRs and then check $BITRISE_GIT_BRANCH for
# merges to origin/main since the destination branch changes back to origin/main
if [[ $BITRISEIO_GIT_BRANCH_DEST = release* ]] || [[ $BITRISEIO_GIT_BRANCH_DEST = epic* ]]; then
FILES_CHANGED=$(git diff --name-only $BITRISEIO_GIT_BRANCH_DEST..."$BITRISE_GIT_COMMIT")
elif [[ $BITRISE_GIT_BRANCH = release* ]] || [[ $BITRISE_GIT_BRANCH = epic* ]]; then
echo "Skipping Blacklist check for Merging into $BITRISE_GIT_BRANCH..."
exit 0
FILES_CHANGED=$(git diff --name-only $BITRISE_GIT_BRANCH..."$BITRISE_GIT_COMMIT")
else
# Branch pushes (no PR) leave $BITRISEIO_GIT_BRANCH_DEST empty, and Bitrise
# clones only the pushed commit - so origin/main may be missing entirely or
# present without a common ancestor, either of which makes the diff below
# fail. Fetch it, and tolerate failure: an empty FILES_CHANGED takes the
# "no files changed" path below and skips the blacklist check rather than
# failing the workflow and skipping the build and tests.
git fetch --no-tags origin main 2>/dev/null || true
FILES_CHANGED=$(git diff --name-only origin/main..."$BITRISE_GIT_COMMIT" 2>/dev/null || true)
fi
# Manual triggers leave empty commits.
# Check for empty commit/PR and exit blacklist check if found to avoid erroring out.
echo "Files changed in commit/PR: $FILES_CHANGED"
if [[ -z "$FILES_CHANGED" ]]; then
echo "No files changed in commit/PR. Skipping Blacklist check..."
envman add --key RUN_UI_TESTS --value Run_UI_Tests
exit 0
fi
# Match on file names in all directories and subdirectories
#
# Project Configs
# .*[^bitrise]\.y[^/]*$ -> matches all files not named bitrise whose file extension begins with a 'y'
# .*\.sh$ -> matches all files whose file extension begins with 'sh'
# .*\.md$ -> matches all files whose file extension begins with 'md'
# .*\.lproj/.* -> matches all files whose parent directory begins with 'lproj'
# fastlane/* -> matches all files in the fastlane directory
# taskcluster/* -> matches all files in the taskcluster directory
#
# Features tested outside bitrise
# Sync*/* -> matches all files in the Sync, SyncTelemetry
# firefox-ios/firefox-ios-tests/Tests/Sync*/* -> matches all files in SyncIntegrationTests directories
# firefox-ios/firefox-ios-tests/Tests/L10nSnapshotTests/* -> matches all files in the L10nSnapshotTests directory
#
# Test Helpers
# test-fixtures/.py$ -> matches all files whose file extension begin with 'py'
DO_NOT_RUN_TESTS='^(.*[^bitrise]\.y[^/]*$|.*\.sh$|.*\.md$|.*\.lproj/.*|Sync*/*|firefox-ios/firefox-ios-tests/Tests/Sync*/*|fastlane/*|taskcluster/*|firefox-ios/firefox-ios-tests/Tests/L10nSnapshotTests/*|test-fixtures/|focus-ios/|.*.py$)'
# Pass the FILES_CHANGED to grep to find any matches for the regex DO_NOT_RUN_TESTS
# -v inverts the filtered results, returning any files not filtered by the regex
if grep -v -E "${DO_NOT_RUN_TESTS}" <<< "${FILES_CHANGED}" && [ -n "$FILES_CHANGED" ];
then
echo "Running UI Tests"
envman add --key RUN_UI_TESTS --value Run_UI_Tests
else
echo "Not Running UI Tests"
fi
- share-pipeline-variable@1:
inputs:
- variables: RUN_UI_TESTS
NewXcodeVersions:
before_run:
- skip_macro_validation
steps:
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
YESTERDAY=`date -v -1d '+%Y-%m-%d'`
brew install jq
resp=$(curl -X GET -s -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/mozilla-mobile/firefox-ios/commits\?sha\=main\&since\=$YESTERDAY | jq -r '.[].commit.message | select(contains("Auto Update Bitrise.YML"))')
echo $resp
if [ -z "$resp" ]
then
echo "There is not any new commit, stop building"
else
echo "There is a new commit, continue building"
envman add --key NEW_XCODE_VERSION --value New_Version_Found
fi
if [[ $BITRISE_GIT_MESSAGE == BuildAndRun* ]]
then
echo "Scheduled build to run the rest of steps once xcode version has been updated"
envman add --key RUN_ALL_STEPS --value Run_All_Steps
fi
title: Check main branch for recent activity before continuing
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- cache-pull@2: {}
- certificate-and-profile-installer@1: {}
- script@1:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
inputs:
- content: |-
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
title: Run bootstrap
- script@1:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
cd firefox-ios/Client.xcodeproj
sed -i '' 's/"Fennec Development"/"Bitrise Firefox iOS Dev"/' project.pbxproj
sed -i '' 's/Fennec ShareTo Development/Bitrise Firefox iOS Dev - Share To/' project.pbxproj
sed -i '' 's/Fennec WidgetKit Development/Bitrise Firefox iOS Dev - WidgetKit/' project.pbxproj
sed -i '' 's/"XCUITests"/"Bitrise Firefox iOS Dev - XCUI Tests"/' project.pbxproj
sed -i '' 's/Fennec NotificationService Development/Bitrise Firefox iOS Dev - Notification Service/' project.pbxproj
sed -i '' 's/CODE_SIGN_IDENTITY = "iPhone Developer"/CODE_SIGN_IDENTITY = "iPhone Distribution"/' project.pbxproj
cd -
title: Set provisioning to Bitrise in xcodeproj
- script@1:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
title: NPM install and build
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
set -x
npm install
npm run build
- xcode-build-for-simulator@3:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
inputs:
- xcodebuild_options: -skipMacroValidation CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
- scheme: Fennec
- simulator_device: iPhone 17
- xcode-test@6:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
inputs:
- scheme: Fennec
- destination: platform=iOS Simulator,name=iPhone 17,OS=27.0
- deploy-to-bitrise-io@2: {}
- slack@4:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
inputs:
- channel: "#firefox-ios"
- text: Build status using latest Xcode detected
- message: "The build run info: $BITRISE_GIT_MESSAGE"
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
description: This Workflow is to build the app using latest xcode available in Bitrise
meta:
bitrise.io:
stack: osx-xcode-27.3.x-edge
machine_type_id: g2.mac.4large
L10nBuild:
before_run:
# - skip_macro_validation # TODO screenshost need build?
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- cache-pull@2: {}
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: |-
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
title: Run bootstrap
- script@1:
title: NPM install and build
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
npm install
npm run build
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.241.1
fastlane -version
xcodebuild -version
./firefox-ios/l10n-screenshots.sh en-US
title: Generate screenshots
- save-cache@1:
inputs:
- key: l10n-screenshots-dd-$GIT_CLONE_COMMIT_HASH
- paths: l10n-screenshots-dd
- deploy-to-bitrise-io@2:
inputs:
- deploy_path: l10n-screenshots/en-US/en-US
- is_compress: 'true'
- script@1:
title: Upload screenshots to Google Cloud Storage
run_if: '{{getenv "BITRISEIO_GCP_L10N_SCREENSHOTS_KEY_URL" | ne ""}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -euo pipefail
curl -sfo /tmp/gcs-key.json "$BITRISEIO_GCP_L10N_SCREENSHOTS_KEY_URL"
gcloud auth activate-service-account -q --key-file /tmp/gcs-key.json
rm -f /tmp/gcs-key.json
ZIP="Firefox-iOS-L10n-en-US-$(date +%Y%m%d).zip"
(cd l10n-screenshots/en-US/en-US && zip -q -9 "$OLDPWD/$ZIP" ./*.png)
DEST="gs://mobile-reports/public/l10n-screenshots/$(date +%F)-${BITRISE_BUILD_NUMBER}/$ZIP"
gcloud storage cp "$ZIP" "$DEST"
echo "Screenshots uploaded to $URL"
envman add --key L10N_SCREENSHOTS_URL --value "$URL"
- slack@4:
title: Notify Slack that screenshots are ready
run_if: '{{and (not .IsBuildFailed) (getenv "L10N_SCREENSHOTS_URL" | ne "") (getenv "NOTIFY_L10N_SLACK" | eq "true")}}'
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_L10N_TEST_ENG"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- pretext: "*Firefox-iOS* :firefox: *L10n screenshots (en-US)* :camera_with_flash: :translation_icon:"
- message: ''
- timestamp: 'no'
- fields: |
Branch | ${BITRISE_GIT_BRANCH}
- buttons: |
Download screenshots (zip)|${L10N_SCREENSHOTS_URL}
Build Log|${BITRISE_BUILD_URL}
envs:
- opts:
is_expand: false
BITRISE_SCHEME: L10nSnapshotTest
description: >-
This Workflow is to run L10n tests in one locale and then share the bundle with
the rest of the builds
L10nBuild_Scheduled:
envs:
- NOTIFY_L10N_SLACK: "true"
after_run:
- L10nBuild
description: >-
Weekly scheduled run of L10nBuild that also posts the en-US screenshots link to Slack
L10nScreenshotsTests:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- certificate-and-profile-installer@1: {}
- restore-cache@2:
inputs:
- key: |-
l10n-screenshots-dd-$GIT_CLONE_COMMIT_HASH
l10n-screenshots-dd-
- paths: l10n-screenshots-dd
title: Download derived data path
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.241.1
fastlane -version
./firefox-ios/l10n-screenshots.sh --test-without-building $MOZ_LOCALES
mkdir -p artifacts
for locale in $(echo $MOZ_LOCALES); do
zip -9 -j "$locale.zip" "l10n-screenshots/$locale/$locale/"*
mv "$locale.zip" artifacts/
done
title: Generate screenshots
- deploy-to-bitrise-io@2:
inputs:
- deploy_path: artifacts/
envs:
- opts:
is_expand: false
BITRISE_SCHEME: L10nSnapshotTest
description: >-
This Workflow is to run L10n tests for all locales
SPM_Deploy_Prod_Beta:
before_run:
- SPM_Common_Steps
steps:
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
cd firefox-ios/Client.xcodeproj
sed -i '' 's/CODE_SIGN_IDENTITY = "iPhone Developer"/CODE_SIGN_IDENTITY = "iPhone Distribution"/' project.pbxproj
cd -
title: Set xcodeproj code_sign_identity
- script@1:
title: NPM, ContentBlockerGen
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Client/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Extensions/NotificationService/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Extensions/ShareTo/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/WidgetKit/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/CredentialProvider/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Sticker/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Extensions/ActionExtension/Info.plist
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
echo "Setting Nimbus variables"
/usr/libexec/PlistBuddy -c "Set NimbusURL $NIMBUS_URL" "firefox-ios/Client/Info.plist"
title: Nimbus Variable Setup
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 43AQ936H96
- export_method: app-store
- output_tool: xcodebuild
- distribution_method: app-store
- export_development_team: 43AQ936H96
- configuration: "$BITRISE_SCHEME"
- deploy-to-bitrise-io@2: {}
- deploy-to-itunesconnect-application-loader@1:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1:
title: Upload Firefox Prod Beta Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
firefox-ios/ThirdParty/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN_FIREFOX" upload-dif \
--org mozilla --project firefox-ios "$BITRISE_DSYM_DIR_PATH"
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
# sleep 9999
is_always_run: true
title: debug-sleep
- slack@4:
inputs:
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 43AQ936H96
- export_method: app-store
- output_tool: xcodebuild
- scheme: FirefoxBeta
- export_development_team: 43AQ936H96
- distribution_method: app-store
- configuration: FirefoxBeta
title: 'FirefoxBeta: Xcode Archive & Export for iOS'
- deploy-to-itunesconnect-application-loader@1:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
title: 'FirefoxBeta: Deploy to iTunes Connect'
- slack@4:
is_always_run: true
run_if: ".IsBuildFailed"
title: 'FirefoxBeta build & deploy failed'
inputs:
- title: ''
- author_name: ''
- pretext_on_error: "*Firefox-iOS* :firefox: *SPM_Deploy_Prod_Beta* :x:"
- buttons: ""
- fields: |
Log | ${BITRISE_BUILD_URL}
- webhook_url: "$SLACK_WEBHOOK_FIREFOX_IOS_DEV"
envs:
- opts:
is_expand: false
BITRISE_SCHEME: Firefox
description: This step is to build, archive and upload Firefox Release and Beta
SPM_Deploy_Beta_Only:
before_run:
- SPM_Common_Steps
steps:
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
cd firefox-ios/Client.xcodeproj
sed -i '' 's/CODE_SIGN_IDENTITY = "iPhone Developer"/CODE_SIGN_IDENTITY = "iPhone Distribution"/' project.pbxproj
cd -
title: Set xcodeproj code_sign_identity
- script@1:
title: NPM, ContentBlockerGen
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: firefox-ios/Client/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: firefox-ios/Extensions/NotificationService/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: firefox-ios/Extensions/ShareTo/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: firefox-ios/WidgetKit/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: firefox-ios/CredentialProvider/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: firefox-ios/Sticker/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: firefox-ios/Extensions/ActionExtension/Info.plist
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
echo "Setting Nimbus variables"
/usr/libexec/PlistBuddy -c "Set NimbusURL $NIMBUS_URL" "firefox-ios/Client/Info.plist"
title: Nimbus Variable Setup
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 43AQ936H96
- export_method: app-store
- output_tool: xcodebuild
- scheme: FirefoxBeta
- export_development_team: 43AQ936H96
- distribution_method: app-store
- configuration: FirefoxBeta
title: 'FirefoxBeta: Xcode Archive & Export for iOS'
- deploy-to-itunesconnect-application-loader@1:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
title: 'FirefoxBeta: Xcode Archive & Export for iOS'
- script@1:
title: Upload Firefox Beta Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
firefox-ios/ThirdParty/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN_FIREFOX" upload-dif \
--org mozilla --project firefox-ios "$BITRISE_DSYM_DIR_PATH"
- slack@4:
is_always_run: true
run_if: ".IsBuildFailed"
title: 'FirefoxBeta build & deploy failed'
inputs:
- title: ''
- author_name: ''
- pretext_on_error: "*Firefox-iOS* :firefox: *SPM_Deploy_Beta_Only* :x:"
- buttons: ""
- fields: |
Log | ${BITRISE_BUILD_URL}
- webhook_url: "$SLACK_WEBHOOK_FIREFOX_IOS_DEV"
envs:
- opts:
is_expand: false
BITRISE_SCHEME: Firefox
description: This step is to build, archive and upload Firefox Release and Beta
SPM_Nightly_Beta_Only:
before_run:
- skip_macro_validation
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
cd firefox-ios/Client.xcodeproj
sed -i '' 's/CODE_SIGN_IDENTITY = "iPhone Developer"/CODE_SIGN_IDENTITY = "iPhone Distribution"/' project.pbxproj
cd -
title: Set xcodeproj code_sign_identity
- script@1:
title: NPM, ContentBlockerGen
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
./bootstrap.sh
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Client/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Extensions/NotificationService/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Extensions/ShareTo/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/WidgetKit/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/CredentialProvider/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Sticker/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Extensions/ActionExtension/Info.plist
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
echo "Setting Nimbus variables"
/usr/libexec/PlistBuddy -c "Set NimbusURL $NIMBUS_URL" "firefox-ios/Client/Info.plist"
title: Nimbus Variable Setup
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 43AQ936H96
- export_method: app-store
- output_tool: xcodebuild
- scheme: FirefoxBeta
- export_development_team: 43AQ936H96
- distribution_method: app-store
- configuration: FirefoxBeta
title: 'FirefoxBeta: Xcode Archive & Export for iOS'
- deploy-to-bitrise-io@2: {}
- deploy-to-itunesconnect-application-loader@1:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
title: 'Nightly FirefoxBeta: Xcode Archive & Export for iOS'
- script@1:
title: Upload NightlyBeta Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
firefox-ios/ThirdParty/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN_FIREFOX" upload-dif \
--org mozilla --project firefox-ios "$BITRISE_DSYM_DIR_PATH"
- slack@4:
is_always_run: true
run_if: ".IsBuildFailed"
title: 'Nightly FirefoxBeta build & deploy failed'
inputs:
- title: ''
- author_name: ''
- pretext_on_error: "*Firefox-iOS* :firefox: *SPM_Nightly_Beta_Only* :x:"
- buttons: ""
- fields: |
Log | ${BITRISE_BUILD_URL}
- webhook_url: "$SLACK_WEBHOOK_FIREFOX_IOS_DEV"
envs:
- opts:
is_expand: false
BITRISE_SCHEME: Firefox
description: This step is to build, archive and upload Firefox Release and Beta
SPM_Nightly_Beta_Mac_Only:
before_run:
- skip_macro_validation
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
cd firefox-ios/Client.xcodeproj
sed -i '' 's/CODE_SIGN_IDENTITY = "iPhone Developer"/CODE_SIGN_IDENTITY = "iPhone Distribution"/' project.pbxproj
cd -
title: Set xcodeproj code_sign_identity
- script@1:
title: NPM, ContentBlockerGen
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
./bootstrap.sh
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Client/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Extensions/NotificationService/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Extensions/ShareTo/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/WidgetKit/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/CredentialProvider/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Sticker/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: firefox-ios/Extensions/ActionExtension/Info.plist
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
echo "Setting Nimbus variables"
/usr/libexec/PlistBuddy -c "Set NimbusURL $NIMBUS_URL" "firefox-ios/Client/Info.plist"
title: Nimbus Variable Setup
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 43AQ936H96
- export_method: app-store
- output_tool: xcodebuild
- scheme: FirefoxBeta
- export_development_team: 43AQ936H96
- distribution_method: app-store
- configuration: FirefoxBeta
- destination: generic/platform=macOS,variant=Mac Designed for iPad
title: 'FirefoxBeta: Xcode Archive & Export for Mac (Designed for iPad)'
- deploy-to-bitrise-io@2: {}
- deploy-to-itunesconnect-application-loader@1:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
- platform: macos
- pkg_path: "$BITRISE_PKG_PATH"
title: 'Nightly FirefoxBeta: Upload to TestFlight (Mac)'
- script@1:
title: Upload NightlyBeta Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
firefox-ios/ThirdParty/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN_FIREFOX" upload-dif \
--org mozilla --project firefox-ios "$BITRISE_DSYM_DIR_PATH"
- slack@4:
is_always_run: true
run_if: ".IsBuildFailed"
title: 'Nightly FirefoxBeta build & deploy failed'
inputs:
- title: ''
- author_name: ''
- pretext_on_error: "*Firefox-iOS* :firefox: *SPM_Nightly_Beta_Only* :x:"
- buttons: ""
- fields: |
Log | ${BITRISE_BUILD_URL}
- webhook_url: "$SLACK_WEBHOOK_FIREFOX_IOS_DEV"
envs:
- opts:
is_expand: false
BITRISE_SCHEME: Firefox
description: This step is to build, archive and upload Firefox Release and Beta
SPM_Common_Steps:
before_run:
- skip_macro_validation
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- certificate-and-profile-installer@1: {}
- script@1:
is_always_run: true
title: Read version from version.txt file
inputs:
- content: |-
#!/usr/bin/env bash
pwd
ls
# Read and trim version string
full_version=$(tr -d '[:space:]' < /Users/vagrant/git/version.txt)
version=$(echo "$full_version" | sed -E 's/^([0-9]+(\.[0-9]+)*).*/\1/')
echo "Version: $version"
# Save version in BITRISE_RELEASE_VERSION
envman add --key BITRISE_RELEASE_VERSION --value "$version"
envman add --key BITRISE_BETA_VERSION --value "$version"
Bitrise_Performance_Test:
steps:
- cache-pull@2:
is_always_run: true
- xcode-test@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- scheme: Fennec
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- test_plan: PerformanceTestPlan
- script@1:
is_always_run: true
title: Create perfherder data object
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# get dependency
cd ./test-fixtures && git clone https://github.com/clarmso/xcresult_extract.git
echo $BITRISE_XCRESULT_PATH
ls
ls $BITRISE_XCRESULT_PATH
cp -r $BITRISE_XCRESULT_PATH /Users/vagrant/Library/Developer/Xcode/DerivedData/**/Logs/Test/
echo "DerivedData/Client/Log/Tests"
ls /Users/vagrant/Library/Developer/Xcode/DerivedData
CLIENT_PATH=$(ls /Users/vagrant/Library/Developer/Xcode/DerivedData | grep 'Client-')
mv /Users/vagrant/Library/Developer/Xcode/DerivedData/$CLIENT_PATH/Logs/Test/Test-Fennec.xcresult /Users/vagrant/Library/Developer/Xcode/DerivedData/$CLIENT_PATH/Logs/Test/Test-Fennec-test.xcresult
ls /Users/vagrant/Library/Developer/Xcode/DerivedData/$CLIENT_PATH/Logs/Test
xcrun xcresulttool graph --path $BITRISE_XCRESULT_PATH --legacy
ls ..
python3 xcresult_extract/xcresult_extract.py -project ../Client.xcodeproj -scheme Fennec
cat data.txt
sed 's/.*=//;s/'\''/"/g' data.txt > test.json
cat test.json
python3 perfTestTransform.py
mkdir -p "$BITRISE_DEPLOY_DIR"
mv perfherder-data.json $BITRISE_DEPLOY_DIR
- deploy-to-bitrise-io@2: {}
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
# Pinned to the pre-Xcode-27 stack: this canary branch deliberately leaves the
# performance tests unchanged so their measurements stay comparable to main.
meta:
bitrise.io:
stack: osx-xcode-26.5.x
machine_type_id: g2.mac.4large
Archive_and_Run_Robo_Test:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
steps:
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 9G8J6YA743
- export_method: development
- distribution_method: development
- export_development_team: 9G8J6YA743
- output_tool: xcodebuild
- scheme: Fennec_Enterprise
- configuration: Fennec_Enterprise
- deploy-to-bitrise-io@2: {}
- script@1:
title: Update Google Cloud SDK Components
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
gcloud components install beta --quiet
gcloud components update --quiet
- script@1:
title: Firebase Test Lab Execution
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
set -o pipefail
curl -o /tmp/key-file.json $BITRISEIO_GOOGLE_APPLICATION_CREDENTIALS_URL
gcloud version
gcloud auth activate-service-account -q --key-file /tmp/key-file.json
gcloud config set project "$GOOGLE_CLOUD_PROJECT"
GCLOUD_OUTPUT=$(gcloud beta firebase test ios run \
--type robo \
--app "$BITRISE_IPA_PATH" \
--device=model=iphonese3,version=18.4 \
--results-bucket=firefox_ios_test_artifacts \
--no-record-video \
--timeout=10m \
--client-details=matrixLabel="Bitrise" \
--quiet 2>&1)
GCLOUD_EXITCODE=$? # this will get the right-most command from the gcloud subshell
echo "GCLOUD_EXITCODE: $GCLOUD_EXITCODE"
# There is a chance the gcloud cli returns a custom array of exit codes, so we will need
# to parse the output to get the exit codes and potentially trigger our own failure
# In the case of an Inconclusive Test, we still haven't confirmed what stand-in exit code
# is returned, so we will need to update this script once we know what it is.
# We also don't know what order the exit codes will be returned in, so we will need to
# parse the output to get the exit codes and then assign them to variables.
envman add --key GCLOUD_EXIT_CODE --value "$GCLOUD_EXITCODE"
MATRIX_WEBLINK=$(echo "$GCLOUD_OUTPUT" | grep 'https://console.firebase.google.com/project' | awk -F '[][]' '{print $2}' | head -n 1)
envman add --key MATRIX_WEBLINK --value "$MATRIX_WEBLINK"
- script@1:
title: Modify Slack Message Based on GCLOUD_EXIT_CODE
inputs:
- content: |-
#!/usr/bin/env bash
# unpack GLCOUD_EXIT_CODE from string to int, if gcloud returns string instead of int for exit code
if [ $((GCLOUD_EXIT_CODE)) -ne 0 ]; then
SLACK_MESSAGE_PRETEXT="*Firefox-iOS* :firefox: *Archive/Robo Test* :x:"
else
SLACK_MESSAGE_PRETEXT="*Firefox-iOS* :firefox: *Archive/Robo Test* :white_check_mark:"
fi
envman add --key SLACK_MESSAGE_PRETEXT --value "$SLACK_MESSAGE_PRETEXT"
- slack@4:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- pretext_on_error: "${SLACK_MESSAGE_PRETEXT}"
- pretext: "${SLACK_MESSAGE_PRETEXT}"
- timestamp: 'no'
- fields: |
Task | ${BITRISE_BUILD_URL}
Commit | ${GIT_CLONE_COMMIT_MESSAGE_SUBJECT}
Source-Workflow | ${BITRISE_TRIGGERED_WORKFLOW_TITLE}
Branch | ${BITRISE_GIT_BRANCH}
Result | ${MATRIX_WEBLINK}
- buttons: |
App|${BITRISE_APP_URL}
Mana|https://mana.mozilla.org/wiki/display/MTE/Mobile+Test+Engineering
meta:
bitrise.io:
stack: osx-xcode-26.2.x
machine_type_id: g2.mac.4large
Firebase_Performance_Test:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
steps:
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 9G8J6YA743
- export_method: development
- distribution_method: development
- export_development_team: 9G8J6YA743
- output_tool: xcodebuild
- scheme: Fennec_Enterprise
- configuration: Fennec_Enterprise
- xcconfig_content: ENABLE_DEBUG_DYLIB=NO
- deploy-to-bitrise-io@2: {}
- script@1:
title: Firebase Build for Testing Physical Devices
inputs:
- content: |
#!/usr/bin/env bash
set -euxo pipefail
DERIVED_DATA_DIR="/Users/vagrant/git/DerivedData"
PROJECT="/Users/vagrant/git/firefox-ios/Client.xcodeproj"
SCHEME="Fennec_Enterprise"
SDK="iphoneos"
DESTINATION="generic/platform=iOS"
PRODUCTS_DIR="${DERIVED_DATA_DIR}/Build/Products"
TEST_PLAN="${SCHEME}_PerformanceTestPlan"
echo "-- build-for-testing --"
mkdir DerivedData
xcodebuild -resolvePackageDependencies -onlyUsePackageVersionsFromResolvedFile -project firefox-ios/Client.xcodeproj
xcodebuild build-for-testing -project "$PROJECT" \
-scheme "$SCHEME" \
-sdk "$SDK" \
-destination "$DESTINATION" \
-derivedDataPath "${DERIVED_DATA_DIR}" \
-skipMacroValidation
ENABLE_DEBUG_DYLIB=NO
echo "-- verify build artifacts --"
if [[ ! -d "$PRODUCTS_DIR" ]]; then
echo "Error: $PRODUCTS_DIR was not created. Check your build steps and try again."
exit 1
fi
if [[ -z $(find "$PRODUCTS_DIR" -type f -name "${TEST_PLAN}*.xctestrun") ]]; then
echo "Error: Missing $TEST_PLAN. Check your scheme and ensure the Test Plan is added."
echo "The files in $PRODUCTS_DIR are:"
ls -l "$PRODUCTS_DIR"
echo "The available test plans for this scheme, $SCHEME, are:"
awk '/<TestPlanReference/,/<\/TestPlanReference>/' \
"${PROJECT}/xcshareddata/xcschemes/${SCHEME}.xcscheme" | \
grep "reference" | \
cut -d '"' -f 2 | \
sed -n 's|container:Tests/\(.*\).xctestplan|\1|p'
exit 1
fi
if [[ ! -d "${PRODUCTS_DIR}/${SCHEME}-${SDK}" ]]; then
echo "Error: Missing sdk for iPhone OS. Check your build sdk argument and try again."
echo "The files in $PRODUCTS_DIR are:"
ls -l "$PRODUCTS_DIR"
echo "The available sdks in this environment are:"
xcodebuild -showsdks | grep -E 'iphoneos|iphonesimulator'
exit 1
fi
- script@1:
title: Create .zip artifact for Firebase Testing
inputs:
- content: |
#!/usr/bin/env bash
set -euxo pipefail
PRODUCTS_DIR="/Users/vagrant/git/DerivedData/Build/Products"
SCHEME="Fennec_Enterprise"
SDK="iphoneos"
TEST_PLAN="${SCHEME}_PerformanceTestPlan"
TARGET_ARCHIVE="/Users/vagrant/git/Fennec_Enterprise.zip"
echo "-- create .zip artifact --"
# do not double-quote $TEST_PLAN, as it is a wildcard and we need it to expand
( cd "$PRODUCTS_DIR" && zip -r "${SCHEME}.zip" "${SCHEME}-${SDK}" ${TEST_PLAN}*.xctestrun )
mv "${PRODUCTS_DIR}/${SCHEME}.zip" "$TARGET_ARCHIVE"
- cache-pull@2:
inputs:
- cache_paths: "$HOME/google-cloud-sdk"
- script@1:
title: Install Google Cloud SDK
inputs:
- content: |-
#!/usr/bin/env bash
set -e
if [ -e $HOME/google-cloud-sdk ]; then
echo "Google Cloud SDK found, skipping installation..."
else
echo "Google Cloud SDK not found, installing..."
curl https://sdk.cloud.google.com > install.sh
bash install.sh --disable-prompts
source $HOME/google-cloud-sdk/path.bash.inc
fi
- script@1:
title: Pin Python version
inputs:
- content: |-
brew install python@3.11
brew unlink python@3.12 || true
brew unlink python@3.11 || true
brew link --force python@3.11
- cache-push@2:
inputs:
- cache_paths: "$HOME/google-cloud-sdk"
- ignore_check_on_paths: "!/Users/vagrant/Library/Developer/Xcode/DerivedData/**"
- compress_archive: "true"
- script@1:
title: Run Performance Tests in Firebase Test Lab
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
TIMESTAMP=$(date "+%Y%m%d%H%M%S")
RESULTS_DIR="firefox_ios_performance_tests_${TIMESTAMP}"
GOOGLE_CLOUD_BUCKET="firefox_ios_test_artifacts"
DEVICE_MODEL="iphonese3" # if updating device model and version, also update firebase-performance.kind
DEVICE_VERSION="26.3"
TARGET_ARCHIVE="/Users/vagrant/git/Fennec_Enterprise.zip" # this should be the same as the artifact created in the previous step
curl -o /tmp/key-file.json "$BITRISEIO_GOOGLE_APPLICATION_CREDENTIALS_URL"
$HOME/google-cloud-sdk/bin/gcloud version
$HOME/google-cloud-sdk/bin/gcloud auth activate-service-account -q --key-file /tmp/key-file.json
$HOME/google-cloud-sdk/bin/gcloud config set project "$GOOGLE_CLOUD_PROJECT"
FIREBASE_TEST_RESULT=$($HOME/google-cloud-sdk/bin/gcloud firebase test ios run \
--test "$TARGET_ARCHIVE" \
--xcode-version=26.2 \
--device model="$DEVICE_MODEL",version="$DEVICE_VERSION" \
--client-details=matrixLabel="Bitrise" \
--num-flaky-test-attempts=2 \
--results-bucket="$GOOGLE_CLOUD_BUCKET" \
--results-dir="$RESULTS_DIR")
FIREBASE_XCRESULT_PATH=$("${HOME}/google-cloud-sdk/bin/gcloud" storage ls "$XCRESULT_PATH" | grep -F ".xcresult")
envman add --key FIREBASE_XCRESULT_PATH --value "$FIREBASE_XCRESULT_PATH"
- script@1:
is_always_run: true
title: Create Perfherder Data Object from Firebase
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -ex
# get dependency
cd ./test-fixtures && git clone https://github.com/clarmso/xcresult_extract.git
# pull firebase xcresult and rename it to extract measurement data
mkdir test_firebase_xcresult
$HOME/google-cloud-sdk/bin/gcloud storage cp -r "$FIREBASE_XCRESULT_PATH" ./test_firebase_xcresult &
# Get the process ID of the backgrounded gcloud storage command
PID=$!
TIMEOUT=60
CHECK_INTERVAL=5
ITERATIONS=$((TIMEOUT / CHECK_INTERVAL))
for ((i = 0; i < ITERATIONS; i++)); do
echo "Waiting for gcloud storage to complete..."
sleep $CHECK_INTERVAL
if ! ps -p $PID > /dev/null; then
wait $PID
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "gcloud storage cp failed with exit code $STATUS"
exit $STATUS
fi
break
fi
done
# if gcloud storage is still running after 60s, it is hanging and needs to be killed
if ps -p $PID > /dev/null; then
echo "The gcloud storage command exceeded the timeout. Stopping and removing contents..."
kill -9 $PID
rm -rf ./test_firebase_xcresult
mkdir ./test_firebase_xcresult
echo "Retrying xcresult copy without multi-processing..."
CLOUDSDK_STORAGE_PROCESS_COUNT=1 CLOUDSDK_STORAGE_THREAD_COUNT=1 $HOME/google-cloud-sdk/bin/gcloud storage cp -r "$FIREBASE_XCRESULT_PATH" ./test_firebase_xcresult
fi
mv ./test_firebase_xcresult/*.xcresult ./test_firebase_xcresult/Test-Fennec-test.xcresult
# firebase xcresult needs to be in the Test dir created during earlier build-for-testing step
FIREBASE_XCRESULT="./test_firebase_xcresult/Test-Fennec-test.xcresult"
CLIENT_PATH=$(ls /Users/vagrant/Library/Developer/Xcode/DerivedData | grep 'Client-')
BITRISE_XCRESULT="/Users/vagrant/Library/Developer/Xcode/DerivedData/${CLIENT_PATH}/Logs/Test/Test-Fennec-test.xcresult"
mv "$FIREBASE_XCRESULT" "$BITRISE_XCRESULT"
# create and print perf data object for perfherder ingest via taskcluster log output
xcrun xcresulttool graph --path "$BITRISE_XCRESULT" --legacy
ls ..
# If this ever breaks, check the xcresult_extract.py function find_xcresult_path
# and figure out exactly what it is doing because we are using Fennec as the scheme
# and it works for both Fennec and Fennec_Enterprise, but I don't know why.
# I would change it here but I am too afraid to break it.
python3 xcresult_extract/xcresult_extract.py -project ../Client.xcodeproj -scheme Fennec
cat data.txt
sed 's/.*=//;s/'\''/"/g' data.txt > test.json
cat test.json
python3 perfTestTransform.py
mkdir -p "$BITRISE_DEPLOY_DIR"
mv perfherder-data.json $BITRISE_DEPLOY_DIR
- deploy-to-bitrise-io@2: {}
meta:
bitrise.io:
stack: osx-xcode-26.2.x
machine_type_id: g2.mac.large
# Firefox_Unit_Tests_iOS_Versions ensures all unit tests pass on the supported iOS versions.
# This workflow runs weekly on Tuesday.
# The results are reported to #tmp-firefox-ios-unit-tests.
Firefox_Unit_Tests_iOS_Versions:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
steps:
- xcode-build-for-test@3:
title: "Build for Testing"
inputs:
- scheme: Fennec
- configuration: Debug
- project_path: /Users/vagrant/git/firefox-ios/Client.xcodeproj
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" -allowProvisioningUpdates DEVELOPMENT_TEAM=$APPLE_TEAM_ID'
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- script@1:
title: "Create .xctestrun files for all iOS versions"
inputs:
- content: |-
SOURCE_FILE="$BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator27.1-arm64.xctestrun"
cp "$SOURCE_FILE" "$BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator26.5-arm64.xctestrun"
cp "$SOURCE_FILE" "$BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator18.6-arm64.xctestrun"
- xcode-test-without-building@0:
title: "Unit Tests - iPhone 18 Pro (iOS 27.0), 3 repetitions"
timeout: 1200
is_always_run: true
inputs:
- project_path: firefox-ios/Client.xcodeproj
- scheme: Fennec
- configuration: Debug
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator27.1-arm64.xctestrun
- test_repetition_mode: until_failure
- maximum_test_repetitions: "3"
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- xcode-test-without-building@0:
title: "Unit Tests - iPhone 17 (iOS 26.5)"
timeout: 6000
is_always_run: true
inputs:
- project_path: firefox-ios/Client.xcodeproj
- scheme: Fennec
- configuration: Debug
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator26.5-arm64.xctestrun
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- xcode-test-without-building@0:
title: "Unit Tests - iPhone 16 (iOS 18.6)"
timeout: 6000
is_always_run: true
inputs:
- project_path: firefox-ios/Client.xcodeproj
- scheme: Fennec
- configuration: Debug
- destination: platform=iOS Simulator,name=iPhone 16,OS=18.6
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator18.6-arm64.xctestrun
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- deploy-to-bitrise-io@2: {}
- script@1:
title: "Capture Xcode Version Info"
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
set -e
# Get Xcode version and build version
XCODE_VER=$(xcodebuild -version | head -n 1 | sed 's/Xcode //g')
BUILD_VER=$(xcodebuild -version | grep "Build version" | sed 's/Build version //g')
echo "Xcode Version: $XCODE_VER"
echo "Build Version: $BUILD_VER"
# Export to environment for Slack notification
envman add --key XCODE_VERSION_INFO --value "$XCODE_VER ($BUILD_VER)"
- slack@4:
inputs:
- webhook_url: $WEBHOOK_SLACK_FIREFOX_IOS_UNIT_TESTS
- author_name: ''
- pretext: ":white_check_mark: Firefox iOS Unit Tests"
- pretext_on_error: ":x: Firefox iOS Unit Tests"
- title:
- title_on_error:
- message:
- message_on_error:
- footer: Mobile Test Engineering
- footer_on_error: Mobile Test Engineering
- footer_icon: https://avatars.slack-edge.com/2025-06-24/9097205871668_a01e2ac8089c067ea5f8_512.png
- footer_icon_on_error: https://avatars.slack-edge.com/2025-06-24/9097205871668_a01e2ac8089c067ea5f8_512.png
- fields: |
iOS Simulators | iPhone 18 Pro - iOS 27.0 (3 repetitions), iPhone 17 - iOS 26.5, iPhone 16 - iOS 18.6
Xcode Version | ${XCODE_VERSION_INFO}
- buttons: Test Results|${BITRISE_BUILD_URL}?tab=tests
Firefox_Sync_Integration_Tests_Smoketest_Regression:
envs:
- SYNC_PYTEST_ARGS: -m "smoketest or regression"
- SYNC_RESULTS_NAME: sync-integration-smoketests-regressions-result
- SYNC_SLACK_TITLE: Sync Integration Tests Smoketest & Regression
after_run:
- _sync_integration_tests
Firefox_Sync_Integration_Tests:
envs:
- SYNC_PYTEST_ARGS: ''
- SYNC_RESULTS_NAME: sync-integration-result
- SYNC_SLACK_TITLE: Sync Integration Tests
after_run:
- _sync_integration_tests
_sync_integration_tests:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
steps:
- script@1:
title: "Run Firefox Sync Integration Tests"
inputs:
- content: |-
#!/usr/bin/env bash
set -e
HOMEBREW_NO_AUTO_UPDATE=1 brew install python@3.12 pipenv
cd firefox-ios/firefox-ios-tests/Tests/SyncIntegrationTests
if [ -n "${CI_WAF_TOKEN:-}" ]; then echo "CI_WAF_TOKEN is set"; else echo "CI_WAF_TOKEN is NOT set"; exit 1; fi
pipenv install --python 3.12
# Run the tests
PYTEST_EXIT=0
eval pipenv run pytest --junitxml=results/junit.xml $SYNC_PYTEST_ARGS || PYTEST_EXIT=$?
# Collect failed tests from the JUnit XML results
FAILED=$(python3 "$BITRISE_SOURCE_DIR/test-fixtures/ci/list_failed_junit_tests.py" results/junit.xml)
envman add --key SYNC_FAILED_TESTS --value "$FAILED"
# Prepare for upload
RESULTS_DIR="$BITRISE_SOURCE_DIR/$SYNC_RESULTS_NAME-$(date +%Y-%m-%d)"
cp -R results "$RESULTS_DIR"
envman add --key SYNC_INTEGRATION_RESULTS_DIR --value "$RESULTS_DIR"
exit $PYTEST_EXIT
- deploy-to-bitrise-io@2:
is_always_run: true
inputs:
- deploy_path: $SYNC_INTEGRATION_RESULTS_DIR
- is_compress: "true"
- slack@4:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- footer_icon_on_error: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer_on_error: Created by Mobile Test Engineering
- pretext_on_error: "*Firefox-iOS* :firefox: *${SYNC_SLACK_TITLE}* :x:"
- message_on_error: "*Failed tests:*\n${SYNC_FAILED_TESTS}"
- color_on_error: danger
- pretext: "*Firefox-iOS* :firefox: *${SYNC_SLACK_TITLE}* :white_check_mark:"
- message: ''
- timestamp: 'no'
- fields: ''
- buttons: |
Build Log|${BITRISE_BUILD_URL}
Test Report|${BITRISE_BUILD_URL}?tab=artifacts
#
# *****%*****%***** FOCUS WORKFLOWS *****%*****%*****
#
focus_configure_build:
before_run:
- focus-clone-and-build-dependencies
steps:
- cache-pull@2: {}
#- swiftlint-extended@1:
# inputs:
# - linting_path: "$BITRISE_SOURCE_DIR"
- script@1:
title: Set Default Web Browser Entitlement
inputs:
- content: |-
#!/usr/bin/env bash
set -x
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" Klar.entitlements
- xcode-build-for-test@3:
inputs:
- scheme: Focus
- configuration: FocusDebug
- project_path: /Users/vagrant/git/focus-ios/Blockzilla.xcodeproj
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- script@1:
title: Override xctestrun Focus env variables
inputs:
- content: |-
#!/usr/bin/env bash
set -euxo pipefail
# Point to the Unit tests plan instead of Accessibility
FOCUS_UI_XCTESTRUN="$BITRISE_TEST_BUNDLE_PATH/Focus_SmokeTest_iphonesimulator27.1-arm64.xctestrun"
echo "Found UITest .xctestrun: $FOCUS_UI_XCTESTRUN"
envman add --key BITRISE_XCTESTRUN_FOCUS_UI_TEST_FILE_PATH --value "$FOCUS_UI_XCTESTRUN"
- xcode-test-without-building@0:
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_UnitTests_iphonesimulator27.1-arm64.xctestrun
- xcode-test-shard-calculation@0:
inputs:
- product_path: $BITRISE_XCTESTRUN_FOCUS_UI_TEST_FILE_PATH
- shard_count: 1
- destination: $BITRISE_DESTINATION
- deploy-to-bitrise-io@2:
inputs:
- pipeline_intermediate_files: |-
BITRISE_TEST_BUNDLE_PATH
BITRISE_TEST_SHARDS_PATH
BITRISE_XCTESTRUN_FOCUS_UI_TEST_FILE_PATH
- slack@4:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "The build failed to build"
- webhook_url: "$SLACK_WEBHOOK"
klar_configure_build:
before_run:
- focus-clone-and-build-dependencies
steps:
- cache-pull@2: {}
#- swiftlint-extended@1:
# inputs:
# - linting_path: "$BITRISE_SOURCE_DIR"
- script@1:
title: Set Default Web Browser Entitlement
inputs:
- content: |-
#!/usr/bin/env bash
set -x
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" Klar.entitlements
- xcode-build-for-test@3:
inputs:
- scheme: Klar
- configuration: KlarDebug
- project_path: /Users/vagrant/git/focus-ios/Blockzilla.xcodeproj
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xcode-test-without-building@0:
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Klar_UnitTests_iphonesimulator26.5-arm64.xctestrun
- deploy-to-bitrise-io@2: {}
- slack@4:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "The build run the Klar testPlan: UnitTests"
- webhook_url: "$SLACK_WEBHOOK"
focus_ui_test:
steps:
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# Check if it is a scheduled or regular build
# to select the testPlan to run
if [[ $BITRISE_GIT_MESSAGE == Schedule* ]]
then
echo "Scheduled build, running Full Functional Tests"
envman add --key TEST_PLAN_NAME --value FullFunctionalTests
else
echo "Regular build, running Smoke Test"
envman add --key TEST_PLAN_NAME --value SmokeTest
fi
- title: Check if build is scheduled or regular to set the test plan
- pull-intermediate-files@1: {}
- xcode-test-without-building@0:
timeout: 1200
inputs:
- only_testing: $BITRISE_TEST_SHARDS_PATH/$BITRISE_IO_PARALLEL_INDEX
- destination: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_SmokeTest_iphonesimulator27.1-arm64.xctestrun
- deploy-to-bitrise-io@2: {}
- github-status@3:
inputs:
- status_identifier: "Focus-build"
- slack@4:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "The build run the Focus testPlan: $TEST_PLAN_NAME"
- webhook_url: "$SLACK_WEBHOOK"
# # FOCUS UTILITIES WORKFLOWS
focus-clone-and-build-dependencies:
description: Clones the repo and builds dependencies
before_run:
- SPM_Common_Steps
steps:
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap -p focus
title: ContentBlockerGen
Focus_Nightly_Tests_iOS18:
envs:
- FOCUS_IOS_VERSION: "18.6"
- FOCUS_IPHONE_DESTINATION: platform=iOS Simulator,name=iPhone 16,OS=18.6
- FOCUS_IPAD_DESTINATION: platform=iOS Simulator,name=iPad (A16),OS=18.6
after_run:
- _focus_nightly_uitests
Focus_Nightly_Tests_iOS26:
envs:
- FOCUS_IOS_VERSION: "26.5"
- FOCUS_IPHONE_DESTINATION: platform=iOS Simulator,name=iPhone 17,OS=26.5
- FOCUS_IPAD_DESTINATION: platform=iOS Simulator,name=iPad (A16),OS=26.5
after_run:
- _focus_nightly_uitests
Focus_Nightly_Tests_iOS27:
envs:
- FOCUS_IOS_VERSION: "27.0"
- FOCUS_IPHONE_DESTINATION: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- FOCUS_IPAD_DESTINATION: platform=iOS Simulator,name=iPad (A16),OS=27.0
- FOCUS_DUO_DESTINATION: platform=iOS Simulator,name=iPhone Duo,OS=27.1
after_run:
- _focus_nightly_uitests
_focus_nightly_uitests:
description: >-
Compile Focus once and run both smoke tests and full functional tests on an iPhone and an iPad, plus iPhone Duo when FOCUS_DUO_DESTINATION is set.
before_run:
- focus-clone-and-build-dependencies
- focus-set-default-browser-entitlement
steps:
- xcode-build-for-test@3:
title: "Build Focus iOS"
inputs:
- scheme: Focus
- configuration: FocusDebug
- project_path: focus-ios/Blockzilla.xcodeproj
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -skipMacroValidation'
- destination: $FOCUS_IPHONE_DESTINATION
- xcode-test-without-building@0:
title: "Focus Smoketest - iPhone"
is_always_run: true
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- destination: $FOCUS_IPHONE_DESTINATION
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_SmokeTest_iphonesimulator27.1-arm64.xctestrun
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- script@1:
title: "Count failed tests - Smoketest - iPhone"
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
if [ -z "$BITRISE_TEST_BUNDLE_PATH" ]; then
FAILED_COUNT="build failed"
else
FAILED_COUNT=$(xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json --legacy 2>/dev/null | jq -r '.metrics.testsFailedCount._value // 0')
fi
echo "Smoketest (iPhone) failures: ${FAILED_COUNT:-n/a}"
envman add --key FOCUS_FAILED_SMOKETEST_IPHONE --value "${FAILED_COUNT:-n/a}"
- xcode-test-without-building@0:
title: "Focus Full Functional Tests - iPhone"
is_always_run: true
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- destination: $FOCUS_IPHONE_DESTINATION
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_FullFunctionalTests_iphonesimulator27.1-arm64.xctestrun
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- script@1:
title: "Count failed tests - Full Functional Tests - iPhone"
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
if [ -z "$BITRISE_TEST_BUNDLE_PATH" ]; then
FAILED_COUNT="build failed"
else
FAILED_COUNT=$(xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json --legacy 2>/dev/null | jq -r '.metrics.testsFailedCount._value // 0')
fi
echo "Full Functional Tests (iPhone) failures: ${FAILED_COUNT:-n/a}"
envman add --key FOCUS_FAILED_FULL_FUNCTIONAL_IPHONE --value "${FAILED_COUNT:-n/a}"
- xcode-test-without-building@0:
title: "Focus Smoketest - iPad"
is_always_run: true
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- destination: $FOCUS_IPAD_DESTINATION
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_SmokeTest_iphonesimulator27.1-arm64.xctestrun
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- script@1:
title: "Count failed tests - Smoketest - iPad"
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
if [ -z "$BITRISE_TEST_BUNDLE_PATH" ]; then
FAILED_COUNT="build failed"
else
FAILED_COUNT=$(xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json --legacy 2>/dev/null | jq -r '.metrics.testsFailedCount._value // 0')
fi
echo "Smoketest (iPad) failures: ${FAILED_COUNT:-n/a}"
envman add --key FOCUS_FAILED_SMOKETEST_IPAD --value "${FAILED_COUNT:-n/a}"
- xcode-test-without-building@0:
title: "Focus Full Functional Tests - iPad"
is_always_run: true
run_if: '{{enveq "BITRISE_TEST_BUNDLE_PATH" "" | not}}'
inputs:
- destination: $FOCUS_IPAD_DESTINATION
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_FullFunctionalTests_iphonesimulator27.1-arm64.xctestrun
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- script@1:
title: "Count failed tests - Full Functional Tests - iPad"
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
if [ -z "$BITRISE_TEST_BUNDLE_PATH" ]; then
FAILED_COUNT="build failed"
else
FAILED_COUNT=$(xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json --legacy 2>/dev/null | jq -r '.metrics.testsFailedCount._value // 0')
fi
echo "Full Functional Tests (iPad) failures: ${FAILED_COUNT:-n/a}"
envman add --key FOCUS_FAILED_FULL_FUNCTIONAL_IPAD --value "${FAILED_COUNT:-n/a}"
- xcode-test-without-building@0:
title: "Focus Smoketest - iPhone Duo"
is_always_run: true
run_if: '{{and (getenv "FOCUS_DUO_DESTINATION" | ne "") (enveq "BITRISE_TEST_BUNDLE_PATH" "" | not)}}'
inputs:
- destination: $FOCUS_DUO_DESTINATION
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_SmokeTest_iphonesimulator27.1-arm64.xctestrun
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- script@1:
title: "Count failed tests - Smoketest - iPhone Duo"
is_always_run: true
run_if: '{{getenv "FOCUS_DUO_DESTINATION" | ne ""}}'
inputs:
- content: |-
#!/usr/bin/env bash
if [ -z "$BITRISE_TEST_BUNDLE_PATH" ]; then
FAILED_COUNT="build failed"
else
FAILED_COUNT=$(xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json --legacy 2>/dev/null | jq -r '.metrics.testsFailedCount._value // 0')
fi
echo "Smoketest (iPhone Duo) failures: ${FAILED_COUNT:-n/a}"
envman add --key FOCUS_FAILED_SMOKETEST_DUO --value "${FAILED_COUNT:-n/a}"
- xcode-test-without-building@0:
title: "Focus Full Functional Tests - iPhone Duo"
is_always_run: true
run_if: '{{and (getenv "FOCUS_DUO_DESTINATION" | ne "") (enveq "BITRISE_TEST_BUNDLE_PATH" "" | not)}}'
inputs:
- destination: $FOCUS_DUO_DESTINATION
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_FullFunctionalTests_iphonesimulator27.1-arm64.xctestrun
- xcodebuild_options: '"ONLY_ACTIVE_ARCH=YES" "COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -collect-test-diagnostics never'
- script@1:
title: "Count failed tests - Full Functional Tests - iPhone Duo"
is_always_run: true
run_if: '{{getenv "FOCUS_DUO_DESTINATION" | ne ""}}'
inputs:
- content: |-
#!/usr/bin/env bash
if [ -z "$BITRISE_TEST_BUNDLE_PATH" ]; then
FAILED_COUNT="build failed"
else
FAILED_COUNT=$(xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json --legacy 2>/dev/null | jq -r '.metrics.testsFailedCount._value // 0')
fi
echo "Full Functional Tests (iPhone Duo) failures: ${FAILED_COUNT:-n/a}"
envman add --key FOCUS_FAILED_FULL_FUNCTIONAL_DUO --value "${FAILED_COUNT:-n/a}"
envman add --key FOCUS_DUO_SLACK_LINE --value "Failed tests on iPhone Duo - Smoketest: ${FOCUS_FAILED_SMOKETEST_DUO:-n/a}, Full Functional Tests: ${FAILED_COUNT:-n/a}"
- deploy-to-bitrise-io@2:
is_always_run: true
- slack@4:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- footer_icon_on_error: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer_on_error: Created by Mobile Test Engineering
- pretext_on_error: "*Focus-iOS* *Nightly Smoketest and Full Functional Tests (iPhone and iPad, iOS ${FOCUS_IOS_VERSION})* :x:"
- message_on_error: |-
Failed tests on iPhone - Smoketest: ${FOCUS_FAILED_SMOKETEST_IPHONE}, Full Functional Tests: ${FOCUS_FAILED_FULL_FUNCTIONAL_IPHONE}
Failed tests on iPad - Smoketest: ${FOCUS_FAILED_SMOKETEST_IPAD}, Full Functional Tests: ${FOCUS_FAILED_FULL_FUNCTIONAL_IPAD}
${FOCUS_DUO_SLACK_LINE}
- color_on_error: danger
- pretext: "*Focus-iOS* *Nightly Smoketest and Full Functional Tests (iPhone and iPad, iOS ${FOCUS_IOS_VERSION})* :white_check_mark:"
- message: ''
- timestamp: 'no'
- fields: |
Branch | ${BITRISE_GIT_BRANCH}
- buttons: |
Build Log|${BITRISE_BUILD_URL}
Test Report|${BITRISE_BUILD_URL}?tab=tests
focus-set-project-version:
steps:
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: focus-ios/Blockzilla/Info.plist
title: Set Blockzilla version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: focus-ios/ContentBlocker/Info.plist
title: Set ContentBlocker version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: focus-ios/FocusIntentExtension/Info.plist
title: Set FocusIntentExtension version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: focus-ios/OpenInFocus/Info.plist
title: Set OpenInFocus version numbers
Firefox_Nightly_SmokeTest_Iphone:
envs:
- SMOKETEST_SCHEME: Fennec
- SMOKETEST_DESTINATION: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- SMOKETEST_SLACK_TITLE: Nightly Smoketest iPhone
after_run:
- _firefox_smoketest
Firefox_SmokeTest_Iphone:
envs:
- SMOKETEST_SCHEME: Firefox
- SMOKETEST_DESTINATION: platform=iOS Simulator,name=iPhone 18 Pro,OS=27.0
- SMOKETEST_SLACK_TITLE: Smoketest Firefox scheme iPhone
after_run:
- _firefox_smoketest
Firefox_SmokeTest_Ipad:
envs:
- SMOKETEST_SCHEME: Firefox
- SMOKETEST_DESTINATION: platform=iOS Simulator,name=iPad (A16),OS=27.0
- SMOKETEST_SLACK_TITLE: Smoketest Firefox scheme iPad
after_run:
- _firefox_smoketest
Firefox_SmokeTest_IphoneDuo:
envs:
- SMOKETEST_SCHEME: Firefox
- SMOKETEST_DESTINATION: platform=iOS Simulator,name=iPhone Duo,OS=27.1
- SMOKETEST_SLACK_TITLE: Smoketest Firefox scheme iPhone Duo
after_run:
- _firefox_smoketest
_firefox_smoketest:
description: >-
Shared steps for the Firefox smoke test workflows. Callers set SMOKETEST_SCHEME, SMOKETEST_DESTINATION
and SMOKETEST_SLACK_TITLE.
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
- skip_macro_validation
steps:
- restore-spm-cache@3:
is_always_run: true
- activate-build-cache-for-xcode@0: {}
- xcode-build-for-test@3:
title: "Build Firefox iOS"
timeout: 360
inputs:
- scheme: $SMOKETEST_SCHEME
- configuration: Debug
- project_path: /Users/vagrant/git/firefox-ios/Client.xcodeproj
- test_plan: Smoketest
- xcodebuild_options: ONLY_ACTIVE_ARCH=YES COMPILER_INDEX_STORE_ENABLE=NO
- destination: $SMOKETEST_DESTINATION
- xcode-test-without-building@0:
title: "Run all smoke tests"
timeout: 3000
inputs:
- destination: $SMOKETEST_DESTINATION
- xcodebuild_options: -collect-test-diagnostics never
- script@1:
title: Count failed tests
is_always_run: true
inputs:
- content: |
echo "Analyzing test results from: $BITRISE_XCRESULT_PATH"
xcrun xcresulttool get --path "$BITRISE_XCRESULT_PATH" --format json > result.json --legacy
FAILED_COUNT=$(jq -r '.metrics.testsFailedCount._value // 0' result.json)
echo "Total number of failures: $FAILED_COUNT"
envman add --key SMOKETEST_FAILED_TEST_COUNT --value "$FAILED_COUNT"
- deploy-to-bitrise-io@2:
is_always_run: true
- slack@4:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer: Created by Mobile Test Engineering
- footer_icon_on_error: https://emoji.slack-edge.com/T07DB2PSS3W/testops-notify/55edcdb3371320b6.png
- footer_on_error: Created by Mobile Test Engineering
- pretext_on_error: "*Firefox-iOS* :firefox: *${SMOKETEST_SLACK_TITLE}* :x:"
- message_on_error: "Number of failed tests: ${SMOKETEST_FAILED_TEST_COUNT}"
- color_on_error: danger
- pretext: "*Firefox-iOS* :firefox: *${SMOKETEST_SLACK_TITLE}* :white_check_mark:"
- message: ''
- timestamp: 'no'
- fields: |
Branch | ${BITRISE_GIT_BRANCH}
- buttons: |
Build Log|${BITRISE_BUILD_URL}
Test Report|${BITRISE_BUILD_URL}?tab=tests
focus-configure-nimbus:
steps:
- script@1:
title: Configure Nimbus
inputs:
- content: |-
#!/usr/bin/env bash
set -x
/usr/libexec/PlistBuddy -c "Add :NimbusServerURL string ${NIMBUS_SERVER_URL}" focus-ios/Blockzilla/Info.plist
/usr/libexec/PlistBuddy -c "Add :NimbusStagingServerURL string ${NIMBUS_STAGING_SERVER_URL}" focus-ios/Blockzilla/Info.plist
/usr/libexec/PlistBuddy -c "Set :NimbusAppName ${NIMBUS_APP_NAME}" focus-ios/Blockzilla/Info.plist
/usr/libexec/PlistBuddy -c "Set :NimbusAppChannel ${NIMBUS_APP_CHANNEL}" focus-ios/Blockzilla/Info.plist
focus-configure-sentry:
steps:
- script@1:
title: Configure Sentry
inputs:
- content: |-
#!/usr/bin/env bash
set -x
/usr/libexec/PlistBuddy -c "Add :SentryDSN string ${SENTRY_DSN_FOCUS}" focus-ios/Blockzilla/Info.plist
focus-set-default-browser-entitlement:
steps:
- script@1:
title: Set Default Web Browser Entitlement
inputs:
- content: |-
#!/usr/bin/env bash
set -x
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Focus.entitlements
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Klar.entitlements
# # Update the name change in Taskcluster files
# focus_l10n_build:
# before_run:
# - focus-clone-and-build-dependencies
# steps:
# - script@1:
# title: Set Default Web Browser Entitlement
# inputs:
# - content: |-
# #!/usr/bin/env bash
# set -x
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Focus.entitlements
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Klar.entitlements
# - script@1:
# title: Generate screenshots
# inputs:
# - content: |-
# #!/usr/bin/env bash
# set -x
# # workaround until 2.187 version is installed. Error with 2.186
# ./focus-ios/focus-ios-tests/l10n-screenshots.sh en-US
# - deploy-to-bitrise-io@1.10:
# inputs:
# - deploy_path: l10n-screenshots-dd/
# - is_compress: 'true'
# - deploy-to-bitrise-io@1.10:
# inputs:
# - deploy_path: l10n-screenshots/en-US/en-US
# - is_compress: 'true'
# focus_l10n_screenshots_tests:
# steps:
# - activate-ssh-key@4:
# run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
# - git-clone@6: {}
# - cache-pull@2: {}
# - certificate-and-profile-installer@1: {}
# - script@1:
# title: Set Default Web Browser Entitlement
# inputs:
# - content: |-
# #!/usr/bin/env bash
# set -x
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Focus.entitlements
# /usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" focus-ios/Klar.entitlements
# - script@1:
# inputs:
# - content: >-
# #!/usr/bin/env bash
# # fail if any commands fails
# set -e
# # debug log
# set -x
# echo "curl to Download derived data"
# curl --location --retry 5 --output l10n-screenshots-dd.zip "$MOZ_DERIVED_DATA_PATH"
# mkdir l10n-screenshots-dd
# unzip l10n-screenshots-dd.zip -d l10n-screenshots-dd
# rm l10n-screenshots-dd.zip
# title: Download derived data path
# - script@1:
# title: Generate screenshots
# inputs:
# - content: |-
# #!/usr/bin/env bash
# # fail if any commands fails
# set -e
# # debug log
# set -x
# # workaround until 2.187 version is installed. Error with 2.186
# ./focus-ios/focus-ios-tests/l10n-screenshots.sh --test-without-building $MOZ_LOCALES
# mkdir -p artifacts
# for locale in $(echo $MOZ_LOCALES); do
# # Only Focus for now
# zip -9 -j "$locale.zip" "l10n-screenshots/$locale/$locale/"*
# mv "$locale.zip" artifacts/
# done
# - deploy-to-bitrise-io@1.10:
# inputs:
# - deploy_path: artifacts/
# # FOCUS RELEASE WORKFLOWS
focus_SPM_Beta:
before_run:
- focus-clone-and-build-dependencies
- focus-set-default-browser-entitlement
- focus-configure-nimbus
- focus-configure-sentry
steps:
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: focus-ios/Blockzilla/Info.plist
title: Set Blockzilla version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: focus-ios/ContentBlocker/Info.plist
title: Set ContentBlocker version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: focus-ios/FocusIntentExtension/Info.plist
title: Set FocusIntentExtension version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_BETA_VERSION"
- plist_path: focus-ios/OpenInFocus/Info.plist
title: Set OpenInFocus version numbers
- certificate-and-profile-installer@1: {}
- xcode-archive@6:
inputs:
- project_path: focus-ios/Blockzilla.xcodeproj
- scheme: Focus
- team_id: 43AQ936H96
- export_method: app-store
title: Build Focus
- deploy-to-itunesconnect-application-loader@1:
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1:
title: Upload Focus Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
focus-ios/focus-ios-tests/tools/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
--org mozilla --project focus-ios "$BITRISE_DSYM_DIR_PATH"
- xcode-archive@6:
inputs:
- project_path: focus-ios/Blockzilla.xcodeproj
- scheme: Klar
- export_method: app-store
title: Build Klar
- deploy-to-itunesconnect-application-loader@1:
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1:
title: Upload Klar Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
focus-ios/focus-ios-tests/tools/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
--org mozilla --project klar-ios "$BITRISE_DSYM_DIR_PATH"
focus_SPM_Nightly:
before_run:
- focus-clone-and-build-dependencies
- focus-set-default-browser-entitlement
- focus-configure-nimbus
- focus-configure-sentry
steps:
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: focus-ios/Blockzilla/Info.plist
title: Set Blockzilla version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: focus-ios/ContentBlocker/Info.plist
title: Set ContentBlocker version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: focus-ios/FocusIntentExtension/Info.plist
title: Set FocusIntentExtension version numbers
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_NIGHTLY_VERSION"
- plist_path: focus-ios/OpenInFocus/Info.plist
title: Set OpenInFocus version numbers
- certificate-and-profile-installer@1: {}
- xcode-archive@6:
inputs:
- project_path: focus-ios/Blockzilla.xcodeproj
- scheme: Focus
- team_id: 43AQ936H96
- export_method: app-store
- distribution_method: app-store
title: Build Focus
- deploy-to-itunesconnect-application-loader@1:
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1:
title: Upload Focus Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
focus-ios/focus-ios-tests/tools/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
--org mozilla --project focus-ios "$BITRISE_DSYM_DIR_PATH"
- xcode-archive@6:
inputs:
- project_path: focus-ios/Blockzilla.xcodeproj
- scheme: Klar
- export_method: app-store
- distribution_method: app-store
title: Build Klar
- deploy-to-itunesconnect-application-loader@1:
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1:
title: Upload Klar Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
focus-ios/focus-ios-tests/tools/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
--org mozilla --project klar-ios "$BITRISE_DSYM_DIR_PATH"
focus_release:
before_run:
- focus-clone-and-build-dependencies
- focus-set-project-version
- focus-set-default-browser-entitlement
- focus-configure-nimbus
- focus-configure-sentry
steps:
- certificate-and-profile-installer@1: {}
- xcode-archive@6:
inputs:
- project_path: focus-ios/Blockzilla.xcodeproj
- scheme: Focus
- team_id: 43AQ936H96
- export_method: app-store
title: Build Focus
- deploy-to-itunesconnect-application-loader@1:
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1:
title: Upload Focus Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
focus-ios/focus-ios-tests/tools/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
--org mozilla --project focus-ios "$BITRISE_DSYM_DIR_PATH"
- xcode-archive@6:
inputs:
- project_path: focus-ios/Blockzilla.xcodeproj
- scheme: Klar
- export_method: app-store
title: Build Klar
- deploy-to-itunesconnect-application-loader@1:
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1:
title: Upload Klar Symbols
inputs:
- content: |-
#!/usr/bin/env bash
set -x
focus-ios/focus-ios-tests/tools/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
--org mozilla --project klar-ios "$BITRISE_DSYM_DIR_PATH"
# RelPro workflows
release_promotion_promote_focus:
before_run:
- focus-clone-and-build-dependencies
- focus-set-project-version
- focus-set-default-browser-entitlement
- focus-configure-nimbus
- focus-configure-sentry
steps:
- script@1:
title: Override default bitrise scheme
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
if [[ "$BITRISE_APP_TITLE" == "staging-firefox-ios" ]]; then
BUILD_TYPE="Debug"
else
BUILD_TYPE="Release"
fi
if [[ ! -z "${API_BITRISE_SCHEME}" ]]; then
envman add --key BITRISE_SCHEME --value "${API_BITRISE_SCHEME}"
envman add --key BITRISE_CONFIG --value "${API_BITRISE_SCHEME}${BUILD_TYPE}"
else
envman add --key BITRISE_SCHEME --value "Focus"
envman add --key BITRISE_CONFIG --value "Focus${BUILD_TYPE}"
fi
- script@1:
# If the current bitrise application is `staging-firefox-ios`, then
# this is a test release made from the staging repository.
# Ignore the value passed by release promotion for `BITRISE_SCHEME` and
# force it to `FirefoxStaging`, which makes it use non production
# certs/profiles. Also override the export method since the scheme is
# using a developer ID, not a distribution one
title: Set staging environment variables
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
envman add --key EXPORT_METHOD --value development
run_if: |-
{{enveq "BITRISE_APP_TITLE" "staging-firefox-ios"}}
- certificate-and-profile-installer@1: {}
- xcode-archive@6:
inputs:
- project_path: focus-ios/Blockzilla.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 43AQ936H96
- export_method: "$EXPORT_METHOD"
- output_tool: xcodebuild
- distribution_method: "$EXPORT_METHOD"
- export_development_team: 43AQ936H96
- configuration: ${BITRISE_CONFIG}
- platform: "iOS"
- scheme: ${BITRISE_SCHEME}
title: Build Focus
- deploy-to-bitrise-io@2: {}
envs:
- opts:
is_expand: false
EXPORT_METHOD: app-store
description: This step is used during release promotion to build a focus release
release_promotion_push_focus:
before_run:
- SPM_Common_Steps
envs:
- IPA_PATH: /tmp/Client.ipa
- DSYM_PATH: /tmp/symbols.zip
steps:
- script@1:
title: Override default bitrise scheme
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
if [[ ! -z "${API_BITRISE_SCHEME}" ]]; then
envman add --key BITRISE_SCHEME --value "${API_BITRISE_SCHEME}"
else
envman add --key BITRISE_SCHEME --value "Focus"
fi
if [[ "${API_BITRISE_SCHEME}" == "Focus" ]]; then
envman add --key SENTRY_PROJECT --value "focus-ios"
else
envman add --key SENTRY_PROJECT --value "klar-ios"
fi
- file-downloader@1:
title: Download Artifact
inputs:
- destination: $IPA_PATH
- source: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/$BUILD_TASK_ID/artifacts/public%2Frelease_promotion_promote_focus%2FFirefox%20${BITRISE_SCHEME}.ipa
- file-downloader@1:
title: Download symbols
inputs:
- destination: $DSYM_PATH
- source: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/$BUILD_TASK_ID/artifacts/public%2Frelease_promotion_promote_focus%2FFirefox%20${BITRISE_SCHEME}.dSYM.zip
- script@1:
title: Check if IPA was downloaded
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
echo "$IPA_PATH"
file "$IPA_PATH"
shasum -a 256 "$IPA_PATH"
unzip -p "$IPA_PATH" "Payload/*.app/Info.plist" | plutil -p - | grep CFBundleIdentifier
unzip -p "$IPA_PATH" "Payload/*.app/Info.plist" | plutil -p - | grep CFBundleVersion
unzip -p "$IPA_PATH" "Payload/*.app/Info.plist" | plutil -p - | grep CFBundleShortVersionString
- script@1:
title: Check if symbols were downloaded
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
echo "$DSYM_PATH"
file "$DSYM_PATH"
- script@1:
title: Upload Firefox Focus Symbols
run_if: |-
{{enveq "BITRISE_APP_TITLE" "firefox-ios"}}
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
firefox-ios/ThirdParty/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \
--org mozilla --project ${SENTRY_PROJECT} "$DSYM_PATH"
- deploy-to-itunesconnect-application-loader@1:
title: Deploy to AppStoreConnect
run_if: |-
{{enveq "BITRISE_APP_TITLE" "firefox-ios"}}
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- ipa_path: $IPA_PATH
- retries: 5
release_promotion_promote:
before_run:
- SPM_Common_Steps
steps:
- script@1:
title: Override default bitrise scheme
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
if [[ ! -z "${API_BITRISE_SCHEME}" ]]; then
envman add --key BITRISE_SCHEME --value "${API_BITRISE_SCHEME}"
fi
- script@1:
# If the current bitrise application is `staging-firefox-ios`, then
# this is a test release made from the staging repository.
# Ignore the value passed by release promotion for `BITRISE_SCHEME` and
# force it to `FirefoxStaging`, which makes it use non production
# certs/profiles. Also override the export method since the scheme is
# using a developer ID, not a distribution one
title: Set staging environment variables
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
envman add --key BITRISE_SCHEME --value FirefoxStaging
envman add --key EXPORT_METHOD --value development
run_if: |-
{{enveq "BITRISE_APP_TITLE" "staging-firefox-ios"}}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
cd firefox-ios/Client.xcodeproj
sed -i '' 's/CODE_SIGN_IDENTITY = "iPhone Developer"/CODE_SIGN_IDENTITY = "iPhone Distribution"/' project.pbxproj
cd -
title: Set xcodeproj code_sign_identity
run_if: |-
{{enveq "BITRISE_APP_TITLE" "firefox-ios"}}
- script@1:
title: NPM, ContentBlockerGen
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
brew trust mozilla-mobile/fxios
brew tap mozilla-mobile/fxios
brew install fxios
fxios bootstrap
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Client/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Extensions/NotificationService/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Extensions/ShareTo/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/WidgetKit/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/CredentialProvider/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Sticker/Info.plist
- set-xcode-build-number@1:
inputs:
- build_short_version_string: "$BITRISE_RELEASE_VERSION"
- plist_path: firefox-ios/Extensions/ActionExtension/Info.plist
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
echo "Setting Nimbus variables"
/usr/libexec/PlistBuddy -c "Set NimbusURL $NIMBUS_URL" "firefox-ios/Client/Info.plist"
title: Nimbus Variable Setup
- xcode-archive@6:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- compile_bitcode: 'no'
- upload_bitcode: 'no'
- team_id: 43AQ936H96
- export_method: "$EXPORT_METHOD"
- output_tool: xcodebuild
- distribution_method: "$EXPORT_METHOD"
- export_development_team: 43AQ936H96
- configuration: "$BITRISE_SCHEME"
- deploy-to-bitrise-io@2: {}
envs:
- opts:
is_expand: false
EXPORT_METHOD: app-store
description: This step is used during release promotion to build a firefox release
AddNightlyGroupToTestFlightBeta:
description: This step is used to add the Nightly group to the Beta build in TestFlight.
before_run:
- SPM_Common_Steps
steps:
- script@1:
title: Add Nightly Group to Beta Build
inputs:
- content: |-
#!/usr/bin/env bash
python3 -m pip install --upgrade pip pyjwt cryptography requests
python3 scripts/nightly_testflight_add_group.py
meta:
bitrise.io:
machine_type_id: g2.mac.large
UpdateAppStoreReleaseNotes:
description: |-
This step writes the "What's New in This Version" text to every App Store Connect
locale, replacing the manual copy-paste. It is a separate manually triggered
workflow because release notes can only be written once the App Store version
record exists in App Store Connect, which happens after release_promotion_push
has uploaded the build.
Start a build with these env vars:
RELEASE_NOTES the text to write to every locale (required, unless
RELEASE_NOTES_FILE or RELEASE_NOTES_JSON is used).
Write \n for a line break and \n\n for a blank line,
so the whole thing fits on one line of the form.
RELEASE_NOTES_VERSION App Store version string to target, for example 154.1.
Optional: when omitted the one editable version is
used, and an ambiguous choice fails. Deliberately not
defaulted from version.txt, which follows the branch
the build ran from rather than the release.
RELEASE_NOTES_DRY_RUN true/1/yes/on to print what would change and write
nothing. An unrecognised value fails rather than
writing to the live App Store listing.
Run it once with RELEASE_NOTES_DRY_RUN=true first: the log names the target app
and version, which is the only check that the right record is being written.
before_run:
- SPM_Common_Steps
steps:
- script@1:
title: Update App Store Release Notes
inputs:
- content: |-
#!/usr/bin/env bash
set -eo pipefail
python3 -m pip install --upgrade pip pyjwt cryptography requests
python3 scripts/update_release_notes.py
release_promotion_push:
before_run:
- SPM_Common_Steps
envs:
- IPA_PATH: /tmp/Client.ipa
- DSYM_PATH: /tmp/symbols.zip
steps:
- file-downloader@1:
title: Download Artifact
inputs:
- destination: $IPA_PATH
- source: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/$BUILD_TASK_ID/artifacts/public%2Frelease_promotion_promote%2FClient.ipa
- file-downloader@1:
title: Download symbols
inputs:
- destination: $DSYM_PATH
- source: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/$BUILD_TASK_ID/artifacts/public%2Frelease_promotion_promote%2FClient.dSYM.zip
- script@1:
title: Check if IPA was downloaded
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
echo "$IPA_PATH"
file "$IPA_PATH"
shasum -a 256 "$IPA_PATH"
unzip -p "$IPA_PATH" "Payload/*.app/Info.plist" | plutil -p - | grep CFBundleIdentifier
unzip -p "$IPA_PATH" "Payload/*.app/Info.plist" | plutil -p - | grep CFBundleVersion
unzip -p "$IPA_PATH" "Payload/*.app/Info.plist" | plutil -p - | grep CFBundleShortVersionString
- script@1:
title: Check if symbols were downloaded
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
echo "$DSYM_PATH"
file "$DSYM_PATH"
- script@1:
title: Upload Firefox Prod Beta Symbols
run_if: |-
{{enveq "BITRISE_APP_TITLE" "firefox-ios"}}
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
firefox-ios/ThirdParty/sentry-cli --auth-token "$SENTRY_AUTH_TOKEN_FIREFOX" upload-dif \
--org mozilla --project firefox-ios "$DSYM_PATH"
- deploy-to-itunesconnect-application-loader@1:
title: Deploy to AppStoreConnect
run_if: |-
{{enveq "BITRISE_APP_TITLE" "firefox-ios"}}
inputs:
- connection: 'off'
- app_password: "$APPLE_ACCOUNT_PW"
- itunescon_user: "$APPLE_ACCOUNT_ID"
- ipa_path: $IPA_PATH
- retries: 5
app:
envs:
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: development
- opts:
is_expand: false
BITRISE_NIGHTLY_VERSION: '9000'
- opts:
is_expand: false
BITRISE_PROJECT_PATH: './firefox-ios/Client.xcodeproj'
- opts:
is_expand: false
BITRISE_SCHEME: 'Fennec'
- opts:
is_expand: false
BITRISE_DESTINATION: 'platform=iOS Simulator,name=Bitrise iOS default,OS=latest'
- opts:
is_expand: false
TEST_FLIGHT_EXTERNAL_GROUP_NAME: Nightly
- opts:
is_expand: false
APPLE_TEAM_ID: '43AQ936H96'
trigger_map:
- push_branch: main
pipeline: pipeline_build_and_test
- push_branch: epic-branch/*
pipeline: pipeline_build_and_test
- push_branch: release/*
pipeline: pipeline_build_and_test
- pull_request_target_branch: main
pipeline: pipeline_build_and_test
- pull_request_target_branch: epic-branch/*
pipeline: pipeline_build_and_test
- pull_request_target_branch: release/v*
pipeline: pipeline_build_and_test
meta:
bitrise.io:
stack: osx-xcode-27.1.x
machine_type_id: g2.mac.4large