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

Use macos-15-xlarge GitHub runner for ios-ci #2896

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2d3da33
Use macos-14 runner
louwers Oct 2, 2024
eb592d1
Use macos-14 runner
louwers Oct 2, 2024
cfeb7aa
Allow not using provisioning profile
louwers Oct 2, 2024
2e19c2a
Use macos-15-xlarge runner
louwers Oct 2, 2024
d1c0438
add macos-15-xlarge to actionlint
louwers Oct 2, 2024
ea9d487
Allow not using provisioning profile for App Bazel target
louwers Oct 2, 2024
d6f914c
Allow not using provisioning profile for uitest target
louwers Oct 2, 2024
2b31450
Use provisioning profile flag for all targets
louwers Oct 3, 2024
38bc81b
Configure provisioning profile when building apps for AWS Device Farm
louwers Oct 3, 2024
4cfcaa0
Use self-signed provisioning profile
louwers Oct 4, 2024
b3b6b5b
Remove CODE_SIGNING_ALLOWED=NO
louwers Oct 4, 2024
06ebb3d
Fix typo
louwers Oct 4, 2024
f9a1f86
Try to fix errros provisioning profile
louwers Oct 4, 2024
780098c
Add private key
louwers Oct 4, 2024
8629126
Remove authorizationdb write
louwers Oct 4, 2024
4c4a9f2
Add public key
louwers Oct 4, 2024
6fed08c
Try another way to import certs
louwers Oct 4, 2024
6a6e82b
Try to fix MapLibre.p12
louwers Oct 4, 2024
98df77c
another attempt
louwers Oct 4, 2024
11c1f99
Update .p12
louwers Oct 4, 2024
ece8958
Also import MapLibre.cer
louwers Oct 4, 2024
e827ff6
set trust of cert
louwers Oct 4, 2024
981a6c6
try default keychain
louwers Oct 4, 2024
f73a9bf
Try macos-14-xlarge
louwers Oct 5, 2024
af0236e
Unlock default keychain
louwers Oct 5, 2024
a2d949c
Use self-hosted runner again
louwers Oct 5, 2024
d07274c
Try unlocking login keychain
louwers Oct 5, 2024
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
1 change: 1 addition & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ self-hosted-runner:
labels:
- macos-14 # can be removed once actionlint is updated
- ubuntu-24.04 # can be removed once actionlint is updated
- macos-15-xlarge
# Configuration variables in array of strings defined in your repository or
# organization. `null` means disabling configuration variables check.
# Empty array means no configuration variable is allowed.
Expand Down
50 changes: 30 additions & 20 deletions .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,18 @@ jobs:
${{ runner.os }}-bazel-
path: ~/.cache/bazel

- name: Build Example (Swift) App
run: bazel build //platform/ios/app-swift:MapLibreApp --//:renderer=metal

- name: Check debug symbols
run: bazel run //platform:check-public-symbols --//:renderer=metal

- name: Lint plist files
run: bazel run //platform/ios:lint-plists --//:renderer=metal

- name: Running iOS tests
run: bazel test //platform/ios/test:ios_test --test_output=errors --//:renderer=metal

# tsan run fails with 'Interceptors are not working. This may be because ThreadSanitizer is loaded too late...'
#- name: Running iOS UI tests (Thread Sanitizer)
# run: bazel test //platform/ios/iosapp-UITests:uitest --test_output=errors --//:renderer=metal --features=tsan

- name: Running iOS UI tests (Address+UB Sanitizer)
run: bazel test //platform/ios/iosapp-UITests:uitest --test_output=errors --//:renderer=metal --features=include_clang_rt --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined --copt=-fsanitize-recover=null --linkopt=-fsanitize-recover=null
- name: Create Bazel config
working-directory: platform/darwin
run: |
grep -v -e APPLE_MOBILE_PROVISIONING_PROFILE_NAME -e APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID bazel/example_config.bzl > bazel/config.bzl
echo 'APPLE_MOBILE_PROVISIONING_PROFILE_NAME = "MapLibre"' >> bazel/config.bzl
echo 'APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID = "MapLibre"' >> bazel/config.bzl

- name: Unlock login keychain
run: security unlock-keychain -p 'ec2-user' ~/Library/Keychains/login.keychain-db

# render test

- name: Build RenderTest .ipa and .xctest for AWS Device Farm
run: |
set -e
Expand All @@ -129,12 +120,31 @@ jobs:
${{ env.render_test_artifacts_dir }}/RenderTest.xctest.zip
${{ env.render_test_artifacts_dir }}/RenderTestApp.ipa

- name: Build Example (Swift) App
run: bazel build //platform/ios/app-swift:MapLibreApp --//:renderer=metal --//platform/ios:use_provisioning_profile=False

- name: Check debug symbols
run: bazel run //platform:check-public-symbols --//:renderer=metal

- name: Lint plist files
run: bazel run //platform/ios:lint-plists --//:renderer=metal

- name: Running iOS tests
run: bazel test //platform/ios/test:ios_test --test_output=errors --//:renderer=metal

# tsan run fails with 'Interceptors are not working. This may be because ThreadSanitizer is loaded too late...'
#- name: Running iOS UI tests (Thread Sanitizer)
# run: bazel test //platform/ios/iosapp-UITests:uitest --test_output=errors --//:renderer=metal --features=tsan

- name: Running iOS UI tests (Address+UB Sanitizer)
run: bazel test //platform/ios/iosapp-UITests:uitest --test_output=errors --//:renderer=metal --features=include_clang_rt --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined --copt=-fsanitize-recover=null --linkopt=-fsanitize-recover=null --//platform/ios:use_provisioning_profile=False

# C++ unit tests

- name: Build CppUnitTests .ipa and .xctest for AWS Device Farm
run: |
set -e
bazel run --//:renderer=metal //platform/ios:xcodeproj
bazel run //platform/ios:xcodeproj --@rules_xcodeproj//xcodeproj:extra_common_flags="--//:renderer=metal"
build_dir="$(mktemp -d)"
xcodebuild build-for-testing -scheme CppUnitTests -project MapLibre.xcodeproj -derivedDataPath "$build_dir"
ios_cpp_test_app_dir="$(dirname "$(find "$build_dir" -name CppUnitTestsApp.app)")"
Expand Down
4 changes: 3 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
use_repo(pnpm, "pnpm")

provisioning_profile_repository = use_extension("@build_bazel_rules_apple//apple:apple.bzl", "provisioning_profile_repository_extension")
provisioning_profile_repository.setup()
provisioning_profile_repository.setup(
fallback_profiles = "//platform/ios/codesign:profiles",
)

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

Expand Down
36 changes: 33 additions & 3 deletions platform/ios/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework", "apple_xcframework")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_framework")
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
Expand Down Expand Up @@ -196,7 +197,10 @@ ios_application(
],
infoplists = ["info_app_plist"],
minimum_os_version = "12.0",
provisioning_profile = "xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
resources = _IOS_APPLICATION_RESOURCES,
version = ":maplibre_app_version",
visibility = ["//visibility:public"],
Expand All @@ -217,7 +221,10 @@ ios_application(
],
infoplists = ["app/Info.plist"],
minimum_os_version = "12.0",
provisioning_profile = ":xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
resources = _IOS_APPLICATION_RESOURCES,
visibility = ["//visibility:public"],
deps = [
Expand All @@ -234,7 +241,10 @@ ios_application(
],
infoplists = ["//platform/ios/benchmark:info_benchmark_plist"],
minimum_os_version = "12.0",
provisioning_profile = "xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
resources = [
"//platform/ios/benchmark:bundle_resources",
"//platform/ios/benchmark/assets:benchmark_assets",
Expand Down Expand Up @@ -364,3 +374,23 @@ js_library(
],
visibility = ["//platform:__pkg__"],
)

bool_flag(
name = "use_provisioning_profile",
build_setting_default = True,
visibility = ["//visibility:public"],
)

config_setting(
name = "without_provisioning_profile",
flag_values = {
"//platform/ios:use_provisioning_profile": "False",
},
)

config_setting(
name = "with_provisioning_profile",
flag_values = {
"//platform/ios:use_provisioning_profile": "True",
},
)
5 changes: 4 additions & 1 deletion platform/ios/app-swift/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ ios_application(
],
infoplists = [":Info.plist"],
minimum_os_version = "16.0",
provisioning_profile = "xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
resources = [
"@pois_nps_mbtiles//file",
],
Expand Down
5 changes: 5 additions & 0 deletions platform/ios/codesign/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filegroup(
name = "profiles",
srcs = ["MapLibre.mobileprovision"],
visibility = ["//visibility:public"],
)
Binary file added platform/ios/codesign/MapLibre.cer
Binary file not shown.
Binary file added platform/ios/codesign/MapLibre.mobileprovision
Binary file not shown.
Binary file added platform/ios/codesign/MapLibre.p12
Binary file not shown.
75 changes: 75 additions & 0 deletions platform/ios/codesign/MapLibre.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AppIDName</key>
<string>selfsigned: any app</string>
<key>ApplicationIdentifierPrefix</key>
<array>
<string>MapLibre</string>
</array>
<key>CreationDate</key>
<date>2024-10-04T14:42:06Z</date>
<key>Platform</key>
<array>
<string>iOS</string>
</array>
<key>IsXcodeManaged</key>
<true/>
<key>DeveloperCertificates</key>
<array>
<data>MIIDOjCCAiKgAwIBAgIBATANBgkqhkiG9w0BAQsFADA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+A=</data>
</array>
<key>Entitlements</key>
<dict>
<key>keychain-access-groups</key>
<array>
<string>MapLibre</string>
</array>
<key>get-task-allow</key>
<true/>
<key>application-identifier</key>
<string>MapLibre.*</string>
<key>com.apple.developer.team-identifier</key>
<string>MapLibre</string>
</dict>
<key>ExpirationDate</key>
<date>2034-10-04T09:54:14Z</date>
<key>Name</key>
<string>MapLibre</string>
<key>ProvisionedDevices</key>
<array>
</array>
<key>LocalProvision</key>
<true/>
<key>TeamIdentifier</key>
<array>
<string>MapLibre</string>
</array>
<key>TeamName</key>
<string>MapLibre</string>
<key>TimeToLive</key>
<integer>3652</integer>
<key>UUID</key>
<string>B05AAC58-7963-4EA6-B158-F8E43432EDE7</string>
<key>Version</key>
<integer>1</integer>
</dict>
</plist>
8 changes: 8 additions & 0 deletions platform/ios/codesign/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Self-Signed Provisioning Profile

This directory contains a self-signed provisioning profile.

```
security import MapLibre.cer
security cms -S -N 'iOS Team Provisioning Profile: *' -i MapLibre.plist -o MapLibre.mobileprovision
```
5 changes: 4 additions & 1 deletion platform/ios/iosapp-UITests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ ios_ui_test(
name = "uitest",
size = "large",
minimum_os_version = "12.0",
provisioning_profile = "xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
test_host = "//platform/ios:App",
visibility = [
"@rules_xcodeproj//xcodeproj:generated",
Expand Down
5 changes: 4 additions & 1 deletion platform/ios/test/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ ios_application(
"//render-test/ios:Info.plist",
],
minimum_os_version = "13.0",
provisioning_profile = "//platform/ios:xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "//platform/ios:xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
visibility = [
"//visibility:public",
],
Expand Down
10 changes: 8 additions & 2 deletions platform/ios/test/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ ios_application(
"Info.plist",
],
minimum_os_version = "13.0",
provisioning_profile = "//platform/ios:xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "//platform/ios:xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
deps = [
"//platform/ios/test/common:test_app_srcs",
],
Expand All @@ -59,7 +62,10 @@ ios_application(
ios_unit_test(
name = "CppUnitTests",
minimum_os_version = "13.0",
provisioning_profile = "//platform/ios:xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "//platform/ios:xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
test_host = "CppUnitTestsApp",
visibility = ["@rules_xcodeproj//xcodeproj:generated"],
deps = [
Expand Down
5 changes: 4 additions & 1 deletion render-test/ios/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ objc_library(
ios_unit_test(
name = "RenderTest",
minimum_os_version = "13.0",
provisioning_profile = "//platform/ios:xcode_profile",
provisioning_profile = select({
"//platform/ios:with_provisioning_profile": "//platform/ios:xcode_profile",
"//platform/ios:without_provisioning_profile": None,
}),
runner = "@build_bazel_rules_apple//apple/testing/default_runner:ios_xctestrun_ordered_runner",
test_host = "//platform/ios/test/common:RenderTestApp",
visibility = [
Expand Down
Loading