Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix MTE-2230 [v124] - Add additional matches in determine_apps_affected Bitrise workflow #18625

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,30 @@ workflows:
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"
Expand All @@ -414,6 +434,11 @@ workflows:
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"
Expand Down