-
Notifications
You must be signed in to change notification settings - Fork 456
Run iOS build in CI #2307
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
Run iOS build in CI #2307
Changes from all commits
0493e7a
abf6641
a94f8fa
3522656
a6a1cde
00a281a
6f4427c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
| #include "Generated.xcconfig" | ||
| #include "Zulip.xcconfig" | ||
|
|
||
| // Compile Swift with "-warnings-as-errors" but only in release builds, so that | ||
| // it doesn't get in the way of quick local experiments for debugging. | ||
| SWIFT_TREAT_WARNINGS_AS_ERRORS = YES |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,7 +34,7 @@ default_suites=( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| analyze test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flutter_version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build_runner l10n drift pigeon icons | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| android # This takes multiple minutes in CI, so do it last. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| android ios # These take multiple minutes in CI, so do them last. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| extra_suites=( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -517,6 +517,78 @@ run_android() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flutter build appbundle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run_ios() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Omitted from this check: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # pubspec.{yaml,lock} tools/check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| files_check ios/ \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # iOS builds require macOS and Xcode. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$(uname -s)" != "Darwin" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Skipping ios suite (not on macOS)." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+526
to
+530
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In non-verbose mode, I think we'd ideally omit the "Skipping ios suite" and also the "Running ios..." line that precedes it. If omitting "Running ios..." seems complicated, I think it would be better to just log both lines, i.e. cut the |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local build_opts=( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${opt_no_pub:+--no-pub} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_no_uncommitted_or_untracked ios/'*'.swift \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if_verbose echo "Checking for style issues in Swift code..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Generated code (*.g.swift) is omitted from this check. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # shellcheck disable=SC2207 # filenames in our own tree, assume well-behaved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local swift_targets=( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(git ls-files -- ios/'*'.swift :!:ios/'*'.g.swift) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # --in-place enables `tools/check --fix ios`; see `check_no_changes`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # TODO: Once we have a dedicated code formatting check, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # move this swift-format check there. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xcrun swift-format format --in-place \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --configuration ios/.swift-format \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "${swift_targets[@]}" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+548
to
+553
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_no_changes "changes to Swift files (swift-format)" ios/'*'.swift \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_no_uncommitted_or_untracked ios/ macos/ \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if_verbose echo "Checking for automated changes from Flutter tooling..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flutter build ios "${build_opts[@]}" --config-only \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+561
to
+564
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly here, about failing right after the log "automated changes from Flutter tooling" when the command that might produce the automated changes hasn't run yet. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check macos/ too, because desktop platforms are supported for dev: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://github.com/zulip/zulip-flutter#desktop-support | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # (This could live in its own suite. If doing that, we'd probably | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # still want to run it in the same GitHub CI workflow as the iOS build, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # since GitHub's macOS-based runners use a lot of our free quota: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://github.com/zulip/zulip-flutter/issues/329#issue-1950704934 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # .) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flutter build macos "${build_opts[@]}" --config-only \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_no_changes "changes to ios" ios/ \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+576
to
+577
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can be clearer that concretely the
Suggested change
Comment on lines
+561
to
+577
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. "Partly" is just because the issue also says Would the following work, for that?
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check_no_changes "changes to macos" macos/ \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if_verbose echo "Building for iOS (in release mode)..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Skip codesigning in CI. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "${opt_output}" = ci ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build_opts+=( --no-codesign ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flutter build ipa "${build_opts[@]}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run_shellcheck() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Omitted from this check: nothing (nothing known, anyway). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| files_check tools/ '!*.'{dart,js,json} \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -568,7 +640,9 @@ print_header() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # We avoid `flutter --version` because, weirdly, when run in a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # GitHub Actions step it takes about 30 seconds. (The first time; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # it's fast subsequent times.) That's even after `flutter precache`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # it's fast subsequent times.) That's even when the Flutter tool's | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # binary artifacts have already been downloaded (which, in CI, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # happens during the `flutter pub get` step). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| describe_git_head "flutter/flutter" "$(flutter_tree)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dart --version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -590,6 +664,7 @@ for suite in "${opt_suites[@]}"; do | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pigeon) maybe_time "$suite" run_pigeon ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| icons) maybe_time "$suite" run_icons ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| android) maybe_time "$suite" run_android ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ios) maybe_time "$suite" run_ios ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shellcheck) maybe_time "$suite" run_shellcheck ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *) echo >&2 "Internal error: unknown suite $suite" ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| esac || failed+=( "$suite" ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git grep precacheshows a dangling reference toflutter precacheintools/check.