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
workflows:
firefox_accessibility_test:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- restore-spm-cache@1:
is_always_run: true
- script@1.1:
title: Build for Testing
inputs:
- content: |
set -euxo pipefail
echo "-- build-for-testing --"
mkdir DerivedData
xcodebuild -resolvePackageDependencies -onlyUsePackageVersionsFromResolvedFile
xcodebuild "-project" "/Users/vagrant/git/firefox-ios/Client.xcodeproj" "-scheme" "Fennec" -configuration "Fennec_Testing" "CODE_SIGNING_ALLOWED=NO" -sdk "iphonesimulator" "-destination" "platform=iOS Simulator,name=iPhone 17,OS=26.2" "COMPILER_INDEX_STORE_ENABLE=NO" "build-for-testing" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO" -derivedDataPath "/Users/vagrant/git/DerivedData" | xcpretty | tee xcodebuild_fennec.log
ls /Users/vagrant/git/DerivedData/Build/Products
ls /Users/vagrant/git/DerivedData
- xcode-test-without-building@0.5.1:
continue_on_fail: true
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- 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.2-arm64.xctestrun"
- maximum_test_repetitions: 2
- script@1.2.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.2.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.9.2:
is_always_run: true
- slack@4.2.1:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T027LFU12/testops-notify/d350cecb43e9e630.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
- decision_to_run_UI_Tests
steps:
- activate-ssh-key@4.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- restore-spm-cache@2.1.1:
is_always_run: true
- activate-build-cache-for-xcode@0: {}
- xcode-build-for-test@3:
inputs:
- scheme: Fennec
- configuration: Fennec_Testing
- 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 17,OS=26.2
- script@1.2.1:
title: Detect number of warnings
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.2.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.2.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_iphonesimulator26.2-arm64.xctestrun"
SMOKE_UI_XCTESTRUN="$BITRISE_TEST_BUNDLE_PATH/Fennec_Smoketest_iphonesimulator26.2-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.5.1:
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Fennec_UnitTest_iphonesimulator26.2-arm64.xctestrun
- maximum_test_repetitions: 2
- 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
- save-spm-cache@1.3.1:
is_always_run: true
- script@1.1.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 "Keeping only one swiftlint report file"
# Remove one format or duplicate copies
rm -f "$BITRISE_DEPLOY_DIR/swiftlint_report.txt" || true
echo "Removing unit test xcresult"
rm -f "$BITRISE_DEPLOY_DIR/Test-Fennec_UnitTest_iphonesimulator18.6-arm64.xcresult.zip"
- deploy-to-bitrise-io@2.10.0:
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.1.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.2.1:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T027LFU12/testops-notify/d350cecb43e9e630.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.2.1:
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
steps:
- pull-intermediate-files@1: {}
- xcode-test-without-building@0.5.1:
timeout: 1200
inputs:
- only_testing: $BITRISE_TEST_SHARDS_PATH_FIREFOX/$BITRISE_IO_PARALLEL_INDEX
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO"'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Fennec_Smoketest_iphonesimulator26.2-arm64.xctestrun
- deploy-to-bitrise-io@2.10.0: {}
determine_apps_affected:
steps:
- git-clone@6.2: {}
- script@1.2.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.2.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.2.1:
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T027LFU12/testops-notify/d350cecb43e9e630.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.2.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
1_git_clone_and_post_clone:
steps:
- activate-ssh-key@4.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- script@1.2.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.7.2: {}
2_certificate_and_profile:
steps:
- certificate-and-profile-installer@1.11.4: {}
- script@1.2.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.2.1:
title: Pin swiftlint version to 0.62.2 (Workaround)
inputs:
- content: |-
OLD_SWIFTLINT_PATH=`which swiftlint`
curl -L -o swiftlint.zip https://github.com/realm/SwiftLint/releases/download/0.62.2/portable_swiftlint.zip
unzip swiftlint.zip -d swiftlint_bin
chmod +x swiftlint_bin/swiftlint
sudo mv swiftlint_bin/swiftlint $OLD_SWIFTLINT_PATH
which swiftlint
swiftlint version
- script@1.2.1:
inputs:
- content: |-
./bootstrap.sh
title: Run bootstrap
- swiftlint-extended@1.0.0:
inputs:
- linting_path: "$BITRISE_SOURCE_DIR"
- lint_config_file: "" # Don't pass a config file to make use of nested configurations
- deploy-to-bitrise-io@2.10.0: {}
- script@1.2.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.2.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
Detect_warnings:
steps:
- script@1.2.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.2.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
FILES_CHANGED=$(git diff --name-only origin/main..."$BITRISE_GIT_COMMIT")
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.1.1:
inputs:
- variables: RUN_UI_TESTS
NewXcodeVersions:
steps:
- script@1.2.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.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- cache-pull@2.7.2: {}
- certificate-and-profile-installer@1.11.4: {}
- script@1.2.1:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
inputs:
- content: |-
./bootstrap.sh
title: Run bootstrap
- script@1.2.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.2.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.0.0:
run_if: '{{getenv "NEW_XCODE_VERSION" | eq "New_Version_Found" | or (getenv "RUN_ALL_STEPS" | eq "Run_All_Steps")}}'
inputs:
- xcodebuild_options: CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
- scheme: Fennec
- simulator_device: iPhone 17
- xcode-test@6.0.0:
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=26.2
- deploy-to-bitrise-io@2.10.0: {}
- slack@4.2.1:
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-26.2.x-edge
machine_type_id: g2.mac.4large
L10nBuild:
steps:
- activate-ssh-key@4.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- cache-pull@2.7.2: {}
- certificate-and-profile-installer@1.11.4: {}
- script@1.2.1:
inputs:
- content: |-
./bootstrap.sh firefox
title: Run bootstrap
- script@1.2.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.2.1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.226.0
fastlane -version
xcodebuild -version
./firefox-ios/l10n-screenshots.sh en-US
title: Generate screenshots
- save-cache@1.4.0:
inputs:
- key: l10n-screenshots-dd-$GIT_CLONE_COMMIT_HASH
- paths: l10n-screenshots-dd
- deploy-to-bitrise-io@2.10.0:
inputs:
- deploy_path: l10n-screenshots/en-US/en-US
- is_compress: 'true'
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
L10nScreenshotsTests:
steps:
- activate-ssh-key@4.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- certificate-and-profile-installer@1.11.4: {}
- restore-cache@2.5.0:
inputs:
- key: |-
l10n-screenshots-dd-$GIT_CLONE_COMMIT_HASH
l10n-screenshots-dd-
- paths: l10n-screenshots-dd
title: Download derived data path
- script@1.2.1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.226.0
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.10.0:
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.2.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.2.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_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.2.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@4.0:
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.9.2: {}
- deploy-to-itunesconnect-application-loader@1.3:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
- script@1.2.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.2.1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
# sleep 9999
is_always_run: true
title: debug-sleep
- slack@3.2:
inputs:
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- xcode-archive@4.0:
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.3:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
title: 'FirefoxBeta: Deploy to iTunes Connect'
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.2.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.2.1:
title: NPM, ContentBlockerGen
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
./bootstrap.sh
- 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.2.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@4.0:
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.3:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
title: 'FirefoxBeta: Xcode Archive & Export for iOS'
- script@1.2.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"
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:
steps:
- activate-ssh-key@4.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- certificate-and-profile-installer@1.11.4: {}
- script@1.2.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.2.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.2.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@4.0:
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.9.2: {}
- deploy-to-itunesconnect-application-loader@1.3:
inputs:
- app_password: "$APPLE_ACCOUNT_PW"
- connection: 'off'
- itunescon_user: "$APPLE_ACCOUNT_ID"
title: 'Nightly FirefoxBeta: Xcode Archive & Export for iOS'
- script@1.2.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"
envs:
- opts:
is_expand: false
BITRISE_SCHEME: Firefox
description: This step is to build, archive and upload Firefox Release and Beta
SPM_Common_Steps:
steps:
- activate-ssh-key@4.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- certificate-and-profile-installer@1.11.4: {}
- script@1.2.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.7.2:
is_always_run: true
- xcode-test@6.0.0:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- scheme: Fennec
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- test_plan: PerformanceTestPlan
- script@1.2.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.10.0: {}
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
Archive_and_Run_Robo_Test:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
steps:
- xcode-archive@5.4.0:
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.10.0: {}
- script@1.2.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.2.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=iphone14pro,version=16.6 \
--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.2.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.2.1:
is_always_run: true
inputs:
- title: ''
- author_name: ''
- webhook_url: "$WEBHOOK_SLACK_TOKEN"
- footer_icon: https://emoji.slack-edge.com/T027LFU12/testops-notify/d350cecb43e9e630.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
Firebase_Performance_Test:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
steps:
- xcode-archive@5.4.0:
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.10.0: {}
- script@1.2.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"
IOS_VERSION="18.2"
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$IOS_VERSION" \
-destination "$DESTINATION" \
-derivedDataPath "${DERIVED_DATA_DIR}" \
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.2.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.7.2:
inputs:
- cache_paths: "$HOME/google-cloud-sdk"
- script@1.2.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.2.1:
title: Pin Python version
inputs:
- content: |-
brew unlink python@3.12
brew unlink python@3.11
brew link --force python@3.11
- cache-push@2.7.1:
inputs:
- cache_paths: "$HOME/google-cloud-sdk"
- ignore_check_on_paths: "!/Users/vagrant/Library/Developer/Xcode/DerivedData/**"
- compress_archive: "true"
- script@1.2.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="iphone15pro" # if updating device model and version, also update firebase-performance.kind
DEVICE_VERSION="18.0"
XCRESULT_PATH="gs://${GOOGLE_CLOUD_BUCKET}/${RESULTS_DIR}/${DEVICE_MODEL}-${DEVICE_VERSION}-en-portrait/TestLogs/"
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=16.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/gsutil" ls "$XCRESULT_PATH" | grep ".xcresult")
envman add --key FIREBASE_XCRESULT_PATH --value "$FIREBASE_XCRESULT_PATH"
- script@1.2.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/gsutil -m cp -r "$FIREBASE_XCRESULT_PATH" ./test_firebase_xcresult &
# Get the process ID of the backgrounded gsutil command
PID=$!
TIMEOUT=60
CHECK_INTERVAL=5
ITERATIONS=$((TIMEOUT / CHECK_INTERVAL))
for ((i = 0; i < ITERATIONS; i++)); do
echo "Waiting for gsutil to complete..."
sleep $CHECK_INTERVAL
if ! ps -p $PID > /dev/null; then
break
fi
done
# if gsutil is still running after 60s, it is hanging and needs to be killed
if ps -p $PID > /dev/null; then
echo "The gsutil 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..."
$HOME/google-cloud-sdk/bin/gsutil 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.10.0: {}
meta:
bitrise.io:
stack: osx-xcode-16.2.x
machine_type_id: g2.mac.4large
Firefox_Unit_Tests:
before_run:
- 1_git_clone_and_post_clone
- 2_certificate_and_profile
- 3_provisioning_and_npm_installation
steps:
- xcode-test@6.0.1:
timeout: 6000
inputs:
- project_path: firefox-ios/Client.xcodeproj
- scheme: Fennec
- configuration: Fennec_Testing
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- test_plan: UnitTest
- 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" "-parallel-testing-enabled" "NO" "-parallel-testing-worker-count" "2"'
- deploy-to-bitrise-io@2.10.0: {}
#
# *****%*****%***** FOCUS WORKFLOWS *****%*****%*****
#
focus_configure_build:
before_run:
- focus-clone-and-build-dependencies
steps:
- cache-pull@2.7.2: {}
#- swiftlint-extended@1:
# inputs:
# - linting_path: "$BITRISE_SOURCE_DIR"
- script@1.2.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: '"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.2
- script@1.2.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_iphonesimulator26.2-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.5.1:
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_UnitTests_iphonesimulator26.2-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.10.0:
inputs:
- pipeline_intermediate_files: |-
BITRISE_TEST_BUNDLE_PATH
BITRISE_TEST_SHARDS_PATH
BITRISE_XCTESTRUN_FOCUS_UI_TEST_FILE_PATH
- slack@4.2.1:
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.7.2: {}
#- swiftlint-extended@1:
# inputs:
# - linting_path: "$BITRISE_SOURCE_DIR"
- script@1.2.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.2
- xcode-test-without-building@0.5.1:
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- 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.2-arm64.xctestrun
- deploy-to-bitrise-io@2.10.0: {}
- slack@4.2.1:
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.2.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.5.1:
timeout: 1200
inputs:
- only_testing: $BITRISE_TEST_SHARDS_PATH/$BITRISE_IO_PARALLEL_INDEX
- destination: platform=iOS Simulator,name=iPhone 17,OS=26.2
- xcodebuild_options: '"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- xctestrun: $BITRISE_TEST_BUNDLE_PATH/Focus_SmokeTest_iphonesimulator26.2-arm64.xctestrun
- deploy-to-bitrise-io@2.10.0: {}
- github-status@3.0.1:
inputs:
- status_identifier: "Focus-build"
- slack@4.2.1:
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.2.1:
inputs:
- content: |-
#!/usr/bin/env bash
./bootstrap.sh focus
title: ContentBlockerGen
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
focus-configure-nimbus:
steps:
- script@1.2.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.2.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.2.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.2: {}
# - 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@3:
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.2.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@3:
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.2.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.11.4: {}
- xcode-archive@3:
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.2.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@3:
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.2.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@3:
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.2.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@3:
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.2.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.2.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.2.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@5:
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.9.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.2.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.2.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.2.1:
title: Check if symbols were downloaded
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
echo "$DSYM_PATH"
file "$DSYM_PATH"
- script@1.2.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.2.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.2.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.2.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.2.1:
title: NPM, ContentBlockerGen
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
./bootstrap.sh
- 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.2.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@5:
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.9.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.2.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
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.2.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.2.1:
title: Check if symbols were downloaded
inputs:
- content: |-
#!/usr/bin/env bash
set -xe
echo "$DSYM_PATH"
file "$DSYM_PATH"
- script@1.2.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-26.2.x
machine_type_id: g2.mac.4large