3 Star 0 Fork 0

Gitee 极速下载 / firefox-ios_old1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/mozilla/firefox-ios
克隆/下载
bitrise.yml 83.60 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148
format_version: '8'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: ios
pipelines:
pipeline_build_and_test:
stages:
- pre_configuration: {}
- build_applications: {}
- run_tests: {}
stages:
pre_configuration:
workflows:
- determine_apps_affected: {}
build_applications:
workflows:
- firefox_configure_build:
run_if: '{{getenv "BUILD_FIREFOX_IOS" | eq "true"}}'
- focus_configure_build:
run_if: '{{getenv "BUILD_FOCUS_IOS" | eq "true"}}'
run_tests:
workflows:
- build_and_test_1_SmokeTest1:
run_if: '{{getenv "BUILD_FIREFOX_IOS" | eq "true"}}'
- build_and_test_2_SmokeTest2:
run_if: '{{getenv "BUILD_FIREFOX_IOS" | eq "true"}}'
- build_and_test_3_SmokeTest3:
run_if: '{{getenv "BUILD_FIREFOX_IOS" | eq "true"}}'
- build_and_test_4_SmokeTest4:
run_if: '{{getenv "BUILD_FIREFOX_IOS" | eq "true"}}'
- focus_ui_test:
run_if: '{{getenv "BUILD_FOCUS_IOS" | eq "true"}}'
- focus_unit_test:
run_if: '{{getenv "BUILD_FOCUS_IOS" | eq "true"}}'
- klar_unit_test:
run_if: '{{getenv "BUILD_FOCUS_IOS" | eq "true"}}'
workflows:
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:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- restore-spm-cache@1:
is_always_run: true
- git::https://github.com/DamienBitrise/bitrise-test-plan-sharder.git@master:
title: Bitrise Test Plan Sharder
inputs:
- xcode_project: Client.xcodeproj
- target: Client
- shards: '4'
- scheme: Fennec
- debug_mode: 'true'
- test_path: ''
- file_type: ".swift"
- 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" "CODE_SIGNING_ALLOWED=NO" -sdk "iphonesimulator" "-destination" "platform=iOS Simulator,name=iPhone 15,OS=17.4" "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:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
timeout: 600
inputs:
- destination: platform=iOS Simulator,name=iPhone 15,OS=17.4
- 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_UnitTest_iphonesimulator17.4-arm64.xctestrun"
- maximum_test_repetitions: 2
- save-spm-cache@1:
is_always_run: true
- script@1.1:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
title: Compress Derived Data
is_always_run: true
inputs:
- content: |
set -euxo pipefail
ls /Users/vagrant/git/DerivedData
ls /Users/vagrant/git/DerivedData/Build/Products
echo "-- compress --"
# Add Fennec-iphonesimulator folder
# Add All .xctestrun files
# Add firefox-ios-test files and test plans
exec zip -0 -qr "${BITRISE_SOURCE_DIR}/DerivedData.zip" \
"$BITRISE_SOURCE_DIR/DerivedData/Build/Products/" \
"$BITRISE_SOURCE_DIR/DerivedData/Build/Products/Fennec-iphonesimulator/" \
"$BITRISE_SOURCE_DIR/firefox-ios/Client.xcodeproj" \
"$BITRISE_SOURCE_DIR/firefox-ios/firefox-ios-tests/" \
"$BITRISE_SOURCE_DIR/firefox-ios/Client/" \
"$BITRISE_SOURCE_DIR/xcodebuild.log"
- deploy-to-bitrise-io@2:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
inputs:
- deploy_path: "${BITRISE_SOURCE_DIR}/DerivedData.zip"
- pipeline_intermediate_files: "$BITRISE_XCRESULT_PATH:BITRISE_XCRESULT_PATH"
- script@1.1:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
title: Run Danger 2
timeout: 180
inputs:
- content: |
#!/usr/bin/env bash
# Fail if any command fails
set -e
echo "Run danger"
swift run danger-swift ci
- cache-push@2.7.1:
is_always_run: true
- script@1.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 /Users/vagrant/git/xcodebuild_fennec.log 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
- slack@3.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}
#mobile-testeng|https://mozilla.slack.com/archives/C02KDDS9QM9
Mana|https://mana.mozilla.org/wiki/display/MTE/Mobile+Test+Engineering
- slack@3.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
build_and_test_1_SmokeTest1:
envs:
- opts:
is_expand: false
SHARD: '1'
after_run:
- _build_and_test
build_and_test_2_SmokeTest2:
envs:
- opts:
is_expand: false
SHARD: '2'
after_run:
- _build_and_test
build_and_test_3_SmokeTest3:
envs:
- opts:
is_expand: false
SHARD: '3'
after_run:
- _build_and_test
build_and_test_4_SmokeTest4:
envs:
- opts:
is_expand: false
SHARD: '4'
after_run:
- _build_and_test
_build_and_test:
before_run:
- 0_detect_standalone_build
- 1_git_clone_and_post_clone
- decision_to_run_UI_Tests
- firefox_pull_and_unzip_dependencies
steps:
- xcode-test-without-building@0:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
timeout: 1200
inputs:
- destination: platform=iOS Simulator,name=iPhone 15,OS=17.4
- xcodebuild_options: '"-derivedDataPath" "/Users/vagrant/git/DerivedData"
"COMPILER_INDEX_STORE_ENABLE=NO" "CODE_SIGN_IDENTITY="
"CODE_SIGNING_REQUIRED=NO" "CODE_SIGNING_ALLOWED=NO"'
- xctestrun: "Users/vagrant/git/DerivedData/Build/Products/Fennec_Smoketest${SHARD}_iphonesimulator17.4-arm64.xctestrun"
- deploy-to-bitrise-io@2.1.1:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
inputs:
- pipeline_intermediate_files: '$BITRISE_XCRESULT_PATH:BITRISE_UITESTS_${SHARD}_XCRESULT_PATH'
determine_apps_affected:
steps:
- git-clone@6.2: {}
- 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:
# Bitrise: https://devcenter.bitrise.io/en/references/available-environment-variables.html
#
# 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 and/or LICENSE file changes
TOTAL_CHANGED_FILES_COUNT=$(git diff --name-only $BASE_BRANCH..."$BITRISE_GIT_COMMIT" | wc -l | xargs)
MD_AND_LICENSE_FILE_COUNT=$(git diff --name-only $BASE_BRANCH..."$BITRISE_GIT_COMMIT" | grep -Eci '(\.md$|^LICENSE$)' | xargs)
if [ "$TOTAL_CHANGED_FILES_COUNT" -eq "$MD_AND_LICENSE_FILE_COUNT" ] && [ "$MD_AND_LICENSE_FILE_COUNT" -ne 0 ]; then
echo "Only Markdown and/or LICENSE 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|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*)
# Explicity 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="true"
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"
- share-pipeline-variable@1:
title: Share which application(s) to base configuration off of
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"
firefox_pull_and_unzip_dependencies:
steps:
- git::https://github.com/bitrise-steplib/bitrise-step-artifact-pull.git@main:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
title: Pull artifacts
inputs:
- verbose: true
- artifact_sources: build_applications.firefox_configure_build
- script@1.1:
run_if: '{{getenv "RUN_UI_TESTS" | eq "Run_UI_Tests"}}'
title: Unzip
inputs:
- content: |
set -euxo pipefail
echo "$BITRISE_ARTIFACT_PATHS"
derived_data=${BITRISE_ARTIFACT_PATHS##*|}
echo "$derived_data"
echo "-- unzip -- "
exec unzip "$derived_data"
send_slack_notification:
steps:
- slack@3.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}
#mobile-testeng|https://mozilla.slack.com/archives/C02KDDS9QM9
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
1_git_clone_and_post_clone:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- script@1.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
- script@1:
title: Add default web browser entitlement for Fennec
inputs:
- content: |-
#/usr/bin/env bash
set -x
echo "Adding com.apple.developer.web-browser to entitlements"
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" firefox-ios/Client/Entitlements/FennecApplication.entitlements
- cache-pull@2.1: {}
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: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8' > /tmp/tmp.xcconfig
echo 'EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))' >> /tmp/tmp.xcconfig
echo 'IPHONEOS_DEPLOYMENT_TARGET=11.4' >> /tmp/tmp.xcconfig
echo 'SWIFT_TREAT_WARNINGS_AS_ERRORS=NO' >> /tmp/tmp.xcconfig
echo 'GCC_TREAT_WARNINGS_AS_ERRORS=NO' >> /tmp/tmp.xcconfig
export XCODE_XCCONFIG_FILE=/tmp/tmp.xcconfig
envman add --key XCODE_XCCONFIG_FILE --value /tmp/tmp.xcconfig
title: Workaround carthage lipo
- script@1.1:
title: Bypass Bitrise Mirror for Swiftlint Upgrade
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
echo "Swiftlint version before mirror swap"
swiftlint version
# Workaround to find the homebrew-core folder
brew tap homebrew/core --force
cd "$(brew --repository)/Library/Taps/homebrew/homebrew-core"
# Bypass Bitrise mirror that lags 1 week to 1 month behind homebrew-core versions
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
brew upgrade swiftlint
echo "Swiftlint version after mirror swap"
swiftlint version
- script@1:
inputs:
- content: |-
./bootstrap.sh
title: Run bootstrap
- swiftlint-extended@1:
inputs:
- linting_path: "$BITRISE_SOURCE_DIR"
- deploy-to-bitrise-io@2.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
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
rm /tmp/tmp.xcconfig
envman add --key XCODE_XCCONFIG_FILE --value ''
title: Remove carthage lipo workaround
3_provisioning_and_npm_installation:
steps:
- script@1.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.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
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/.*.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:
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' -H "authorization: Bearer ${GITHUB_ACCESS_TOKEN}" 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.0:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- cache-pull@2.4: {}
- 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: |-
#!/usr/bin/env bash
set -e
set -x
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8' > /tmp/tmp.xcconfig
echo 'EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))' >> /tmp/tmp.xcconfig
echo 'IPHONEOS_DEPLOYMENT_TARGET=11.4' >> /tmp/tmp.xcconfig
echo 'SWIFT_TREAT_WARNINGS_AS_ERRORS=NO' >> /tmp/tmp.xcconfig
echo 'GCC_TREAT_WARNINGS_AS_ERRORS=NO' >> /tmp/tmp.xcconfig
export XCODE_XCCONFIG_FILE=/tmp/tmp.xcconfig
envman add --key XCODE_XCCONFIG_FILE --value /tmp/tmp.xcconfig
title: Workaround carthage lipo bug
- script@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:
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
rm /tmp/tmp.xcconfig
envman add --key XCODE_XCCONFIG_FILE --value ''
title: Remove carthage lipo workaround
- 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.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@0.12:
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 15
- xcode-test@4.5:
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 15,OS=17.4
- deploy-to-bitrise-io@2.2: {}
- cache-push@2.4: {}
- slack@3.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
L10nBuild:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- cache-pull@2.1: {}
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: >-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
echo
'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64
arm64e armv7 armv7s armv6 armv8' > /tmp/tmp.xcconfig
echo 'EXCLUDED_ARCHS=$(inherited)
$(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))'
>> /tmp/tmp.xcconfig
echo 'IPHONEOS_DEPLOYMENT_TARGET=11.4' >> /tmp/tmp.xcconfig
echo 'SWIFT_TREAT_WARNINGS_AS_ERRORS=NO' >> /tmp/tmp.xcconfig
echo 'GCC_TREAT_WARNINGS_AS_ERRORS=NO' >> /tmp/tmp.xcconfig
export XCODE_XCCONFIG_FILE=/tmp/tmp.xcconfig
envman add --key XCODE_XCCONFIG_FILE --value /tmp/tmp.xcconfig
title: Workaround carthage lipo
- script@1:
inputs:
- content: |-
./bootstrap.sh
title: Run bootstrap
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -e
set -x
rm /tmp/tmp.xcconfig
envman add --key XCODE_XCCONFIG_FILE --value ''
title: Remove carthage lip
- script@1.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.1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.219.0
fastlane -version
./firefox-ios/l10n-screenshots.sh en-US
title: Generate screenshots
- 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'
- cache-push@2.3: {}
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:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: >-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
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.1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
gem install fastlane -v 2.219.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@1.10:
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:
steps:
- activate-ssh-key@4.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- 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.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
- 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@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.0: {}
- 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:
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@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:
steps:
- activate-ssh-key@4.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- 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.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
- 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@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:
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:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- 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.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
- 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@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: {}
- 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:
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
Bitrise_Performance_Test:
steps:
- cache-pull@2.1:
is_always_run: true
- xcode-test@4.5:
inputs:
- project_path: firefox-ios/Client.xcodeproj
- scheme: Fennec
- destination: platform=iOS Simulator,name=iPhone 15,OS=17.4
- test_plan: PerformanceTestPlan
- script@1.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/isabelrios/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
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
- deploy-to-bitrise-io@1.9: {}
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@4.7.2:
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: {}
- cache-pull@2.7.2:
inputs:
- cache_paths: "$HOME/sdk/google-cloud-sdk"
- script@1:
title: Install Google Cloud SDK
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
if [ -e $HOME/sdk/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 --install-dir=$HOME/sdk
source $HOME/sdk/google-cloud-sdk/path.bash.inc
gcloud components install beta --quiet
fi
- cache-push@2.7.1:
inputs:
- cache_paths: "$HOME/sdk/google-cloud-sdk"
- ignore_check_on_paths: "!/Users/vagrant/Library/Developer/Xcode/DerivedData/**"
- compress_archive: "true"
- 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
$HOME/sdk/google-cloud-sdk/bin/gcloud version
$HOME/sdk/google-cloud-sdk/bin/gcloud auth activate-service-account -q --key-file /tmp/key-file.json
$HOME/sdk/google-cloud-sdk/bin/gcloud config set project "$GOOGLE_CLOUD_PROJECT"
GCLOUD_OUTPUT=$($HOME/sdk/google-cloud-sdk/bin/gcloud beta firebase test ios run \
--type robo \
--app "$BITRISE_IPA_PATH" \
--device=model=iphone13pro,version=15.7 \
--device=model=iphone8,version=16.6 \
--results-bucket=firefox_ios_test_artifacts \
--no-record-video \
--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@3.5.0:
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}
#mobile-testeng|https://mozilla.slack.com/archives/C02KDDS9QM9
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@4.7.2:
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.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}"
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.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:
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
- 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:
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="iphone14pro" # if updating device model and version, also update firebase-performance.kind
DEVICE_VERSION="16.6"
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" \
--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.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/isabelrios/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"
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
#
# *****%*****%***** 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" Focus.entitlements
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.web-browser bool true" Klar.entitlements
- script@1.1:
title: Build for Testing Focus
inputs:
- content: |
set -euxo pipefail
echo "-- build-for-testing --"
mkdir DerivedData
#xcodebuild -resolvePackageDependencies -onlyUsePackageVersionsFromResolvedFile
xcodebuild "-project" "/Users/vagrant/git/focus-ios/Blockzilla.xcodeproj" "-scheme" "Focus" -configuration "FocusDebug" "CODE_SIGNING_ALLOWED=NO" "-destination" "platform=iOS Simulator,name=iPhone 15,OS=17.4" "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_test.log
- script@1.1:
title: Build for Testing Klar
inputs:
- content: |
set -euxo pipefail
echo "-- build-for-testing --"
xcodebuild "-project" "/Users/vagrant/git/focus-ios/Blockzilla.xcodeproj" "-scheme" "Klar" -configuration "KlarDebug" "CODE_SIGNING_ALLOWED=NO" "-destination" "platform=iOS Simulator,name=iPhone 15,OS=17.4" "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_test.log
- script@1.1:
title: Compress Derived Data
is_always_run: true
inputs:
- content: |
set -euxo pipefail
echo "-- compress --"
# Add FocusDebug-iphonesimulator folder
# Add All .xctestrun files
# Add focuos-ios-test files and test plans
# Add KlarDebug-iphonesimulator folder
exec zip -0 -qr "${BITRISE_SOURCE_DIR}/DerivedData.zip" \
"${BITRISE_SOURCE_DIR}/focus-ios/Blockzilla.xcodeproj" \
"$BITRISE_SOURCE_DIR/DerivedData/Build/Products/FocusDebug-iphonesimulator/" \
"$BITRISE_SOURCE_DIR/DerivedData/Build/Products/KlarDebug-iphonesimulator/" \
"$BITRISE_SOURCE_DIR/DerivedData/Build/Products/" \
"$BITRISE_SOURCE_DIR/focus-ios/focus-ios-tests/" \
"$BITRISE_SOURCE_DIR/focus-ios/xcodebuild.log" \
"$BITRISE_SOURCE_DIR/focus-ios/Blockzilla/"
- deploy-to-bitrise-io@2:
inputs:
- deploy_path: "${BITRISE_SOURCE_DIR}/DerivedData.zip"
- slack@3:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "The build failed to build"
- webhook_url: "$SLACK_WEBHOOK"
focus_ui_test:
before_run:
- focus-pull-and-unzip-dependencies
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
- script@1.1:
title: Test without Building
inputs:
- content: |
#!/usr/bin/env bash
set -ex
ls ./Users/vagrant/git/focus-ios/focus-ios-tests/XCUITest/
ls ./Users/vagrant/git/DerivedData/Build/Products
cp -r ./Users/vagrant/git/focus-ios/focus-ios-tests/XCUITest/* .
mv ./Users/vagrant/git/* .
ls -la
echo "-- test-without-building --"
xcodebuild -resultBundlePath "xcodebuild.xcresult" -derivedDataPath "/Users/vagrant/git/DerivedData" -destination "platform=iOS Simulator,name=iPhone 15,OS=17.4" test-without-building -xctestrun "/Users/vagrant/git/DerivedData/Build/Products/Focus_SmokeTest_iphonesimulator17.4-arm64.xctestrun"
- custom-test-results-export@0:
inputs:
- search_pattern: "$BITRISE_SOURCE_DIR/xcodebuild.xcresult"
- test_name: SmokeTest
- deploy-to-bitrise-io@2: {}
- github-status@2:
inputs:
- status_identifier: "Focus-build"
- slack@3:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "The build run the Focus testPlan: $TEST_PLAN_NAME"
- webhook_url: "$SLACK_WEBHOOK"
klar_unit_test:
before_run:
- focus-pull-and-unzip-dependencies
steps:
- script@1.1:
title: Test without Building
inputs:
- content: |
#!/usr/bin/env bash
set -ex
ls ./Users/vagrant/git/focus-ios/Blockzilla.xcodeproj/
cp -r ./Users/vagrant/git/focus-ios/Blockzilla.xcodeproj/* .
mv ./Users/vagrant/git/* .
ls -la
echo "-- test-without-building --"
xcodebuild -resultBundlePath "xcodebuild.xcresult" -derivedDataPath "/Users/vagrant/git/DerivedData" -destination "platform=iOS Simulator,name=iPhone 15,OS=17.4" test-without-building -xctestrun "/Users/vagrant/git/DerivedData/Build/Products/Klar_UnitTests_iphonesimulator17.4-arm64.xctestrun"
- custom-test-results-export@0:
inputs:
- search_pattern: "$BITRISE_SOURCE_DIR/xcodebuild.xcresult"
- test_name: UnitTestsKlar
- deploy-to-bitrise-io@2: {}
- slack@3:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "The build run the Klar testPlan: UnitTests"
- webhook_url: "$SLACK_WEBHOOK"
focus_unit_test:
before_run:
- focus-pull-and-unzip-dependencies
steps:
- script@1.1:
title: Test without Building
inputs:
- content: |
#!/usr/bin/env bash
set -ex
ls ./Users/vagrant/git/focus-ios/Blockzilla.xcodeproj/
cp -r ./Users/vagrant/git/focus-ios/Blockzilla.xcodeproj/* .
mv ./Users/vagrant/git/* .
ls -la
echo "-- test-without-building --"
xcodebuild -resultBundlePath "xcodebuild.xcresult" -derivedDataPath "/Users/vagrant/git/DerivedData" -destination "platform=iOS Simulator,name=iPhone 15,OS=17.4" test-without-building -xctestrun "/Users/vagrant/git/DerivedData/Build/Products/Focus_UnitTests_iphonesimulator17.4-arm64.xctestrun"
- custom-test-results-export@0:
inputs:
- search_pattern: "$BITRISE_SOURCE_DIR/xcodebuild.xcresult"
- test_name: UnitTests
- deploy-to-bitrise-io@2: {}
- slack@3:
run_if: ".IsBuildFailed"
inputs:
- channel: "#mobile-alerts-ios"
- message: "The build run the Focus testPlan: UnitTests"
- webhook_url: "$SLACK_WEBHOOK"
# # FOCUS UTILITIES WORKFLOWS
focus-clone-and-build-dependencies:
description: Clones the repo and builds dependencies
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6.2: {}
- certificate-and-profile-installer@1: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
./checkout.sh
title: ContentBlockerGen
focus-pull-and-unzip-dependencies:
description: Pulls and unzip the dependencis from previous stage
steps:
- git::https://github.com/bitrise-steplib/bitrise-step-artifact-pull.git@main:
title: Pull artifacts
inputs:
- verbose: true
- artifact_sources: build_applications.focus_configure_build
- script@1.1:
title: Unzip
inputs:
- content: |
set -euxo pipefail
echo "$BITRISE_ARTIFACT_PATHS"
echo "-- unzip -- "
exec unzip "${BITRISE_ARTIFACT_PATHS}"
echo "show dir"
ls
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:
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-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.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:
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:
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@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:
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:
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:
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:
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"
app:
envs:
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: development
- opts:
is_expand: false
BITRISE_NIGHTLY_VERSION: '9000'
- opts:
is_expand: false
BITRISE_RELEASE_VERSION: '128.0'
- opts:
is_expand: false
BITRISE_BETA_VERSION: '128.0'
trigger_map:
- push_branch: main
pipeline: pipeline_build_and_test
- push_branch: epic-branch/*
pipeline: pipeline_build_and_test
- push_branch: release/v128
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-15.3.x
machine_type_id: g2-m1.8core
1
https://gitee.com/mirrors/firefox-ios_old1.git
git@gitee.com:mirrors/firefox-ios_old1.git
mirrors
firefox-ios_old1
firefox-ios_old1
main

搜索帮助