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

IOS-8184: Use GitHub runners for tests #4009

Merged
merged 9 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:
jobs:
test:
name: Test
runs-on: self-hosted
runs-on: macos-14
if: github.event.pull_request.draft == false
steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15.4.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16 changes: 14 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@ ALPHA_SCHEME = "Tangem Alpha"
FIREBASE_TESTERS_GROUP = "testers"

before_all do |lane, options|
xcode_select("/Applications/Xcode.app")
if options[:xcode_version_override].nil?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я собирался добавить это в задаче по ci/cd, но в принципе ничего не мешает уже сейчас добавить

xcodes() # Will use the Xcode version from the .xcode-version file
Copy link
Contributor Author

@m3g0byt3 m3g0byt3 Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Официальный экшн, не какое-то поделие https://docs.fastlane.tools/actions/xcodes/

Если нужный Xcode и так стоит - то ничего устанавливаться не будет:

[14:09:12]: Running xcodes version 1.5.0
[14:09:12]: $ /opt/homebrew/bin/xcodes install '15.4.0' --update --select
[14:09:12]: ▸ Xcode 15.4.0 is already selected
[14:09:12]: $ /opt/homebrew/bin/xcodes installed '15.4.0'
[14:09:12]: ▸ /Applications/Xcode_15.4.app
[14:09:12]: Setting Xcode version '15.4.0' at '/Applications/Xcode_15.4.app' for all build steps


Еще он будет полезен с учетом вот этого breaking change actions/runner-images#10703 - скоро раннеры будут иметь только одну мажорную версию Xcode, а не набор как сейчас:

16.1 (beta) 16B5014f /Applications/Xcode_16.1_beta_2.app
16.0 16A242d /Applications/Xcode_16.app
15.4 (default) 15F31d /Applications/Xcode_15.4.app
15.3 15E204a /Applications/Xcode_15.3.app
15.2 15C500b /Applications/Xcode_15.2.app
15.1 15C65 /Applications/Xcode_15.1.app
15.0.1 15A507 /Applications/Xcode_15.0.1.app
14.3.1 14E300c /Applications/Xcode_14.3.1.app


В образе для раннера этот экшн уже стоит, на self-hosted раннерре его надо будет поставить и один раз запустить, чтобы он сохранил логин-пароль для скачивания xcode https://github.com/XcodesOrg/xcodes?tab=readme-ov-file#install-xcode-

else
xcodes(version: options[:xcode_version_override])
end

Dir.chdir("..") do
sh("./bootstrap.sh")
end

ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"
ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"] = "4"
Comment on lines +20 to +21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Периодически стреляет, лишним не будет

end

desc """
A lane that builds and tests the scheme \"Tangem\" using a clean and build application.
Using enviroment: Production
Options:
- xcode_version_override: Xcode version to use, optional (uses https://github.com/XcodesOrg/xcodes under the hood)
"""
lane :test do
lane :test do |options|
run_tests(
workspace: "TangemApp.xcworkspace",
scheme: PRODUCTION_SCHEME,
Expand All @@ -34,6 +43,7 @@ desc """
- version: app version
- build: optional build number
- changelog: string for description archive
- xcode_version_override: Xcode version to use, optional (uses https://github.com/XcodesOrg/xcodes under the hood)
"""
lane :release do |options|
app_store_connect_api_key(duration: 1200, is_key_content_base64: true)
Expand Down Expand Up @@ -62,6 +72,7 @@ Options:
- version: app version
- build: optional build number
- changelog: string for description archive
- xcode_version_override: Xcode version to use, optional (uses https://github.com/XcodesOrg/xcodes under the hood)
"""
lane :beta do |options|
increment_version_number(version_number: options[:version])
Expand All @@ -88,6 +99,7 @@ Options:
- version: app version
- build: optional build number
- changelog: string for description archive
- xcode_version_override: Xcode version to use, optional (uses https://github.com/XcodesOrg/xcodes under the hood)
"""
lane :alpha do |options|
increment_version_number(version_number: options[:version])
Expand Down
Loading