Skip to content

Commit c60610b

Browse files
committed
WIP fastlane: enable for iOS app
1 parent 875d5f7 commit c60610b

4 files changed

Lines changed: 50 additions & 47 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,33 @@ jobs:
2929
# uses: StanfordBDHG/.github/.github/workflows/periphery.yml@v2
3030
# permissions:
3131
# contents: read
32-
# codeql:
33-
# name: CodeQL
34-
# uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
35-
# with:
36-
# codeql: true
37-
# fastlanelane: codeql
38-
# permissions:
39-
# security-events: write
40-
# actions: read
41-
# buildandtest:
42-
# name: Build and Test
43-
# uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
44-
# strategy:
45-
# fail-fast: false
46-
# matrix:
47-
# platform: [iphone, vision_pro]
48-
# with:
49-
# # We use the self-hosted runners as the main GitHub Action runners do not have the necessary performance.
50-
# # Remove the `runsonlabels: '["macOS", "self-hosted"]'` lines if you do not administer your own GitHub Runners.
51-
# runsonlabels: '["macOS", "self-hosted"]'
52-
# fastlanelane: test_${{ matrix.platform }}
53-
# artifactname: ${{ matrix.platform }}.xcresult
54-
# uploadcoveragereport:
55-
# name: Upload Coverage Report
56-
# needs: [buildandtest]
57-
# uses: StanfordBDHG/.github/.github/workflows/create-and-upload-coverage-report.yml@v2
58-
# with:
59-
# coveragereports: iphone.xcresult vision_pro.xcresult
60-
# secrets:
61-
# token: ${{ secrets.CODECOV_TOKEN }}
32+
codeql:
33+
name: CodeQL
34+
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
35+
with:
36+
codeql: true
37+
fastlanelane: ios_codeql
38+
permissions:
39+
security-events: write
40+
actions: read
41+
buildandtest:
42+
name: Build and Test
43+
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
platform: [iphone]
48+
with:
49+
# We use the self-hosted runners as the main GitHub Action runners do not have the necessary performance.
50+
# Remove the `runsonlabels: '["macOS", "self-hosted"]'` lines if you do not administer your own GitHub Runners.
51+
runsonlabels: '["macOS", "self-hosted"]'
52+
fastlanelane: ios test_iphone # ${{ matrix.platform }}
53+
artifactname: ${{ matrix.platform }}.xcresult
54+
uploadcoveragereport:
55+
name: Upload Coverage Report
56+
needs: [buildandtest]
57+
uses: StanfordBDHG/.github/.github/workflows/create-and-upload-coverage-report.yml@v2
58+
with:
59+
coveragereports: iphone.xcresult
60+
secrets:
61+
token: ${{ secrets.CODECOV_TOKEN }}

fastlane/Appfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
# For more information about the Appfile, see:
1010
# https://docs.fastlane.tools/advanced/#appfile
1111

12-
app_identifier "edu.stanford.spatialcontinuity" # The bundle identifier of your app
1312
apple_id ENV["APPLE_ID"] # Your Apple email address
13+
for_platform :ios do
14+
app_identifier 'edu.stanford.spatialcontinuitycamera'
15+
end

fastlane/ExportOptions.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
<string>app-store</string>
77
<key>provisioningProfiles</key>
88
<dict>
9-
<key>edu.stanford.spatialcontinnuity</key>
10-
<string>SpatialContinuity</string>
119
<key>edu.stanford.spatialcontinuitycamera</key>
1210
<string>SpatialContinuityCamera</string>
1311
</dict>

fastlane/Fastfile

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#
2-
# This source file is part of the StanfordBDHG Template Application project
2+
# This source file is part of the Spatial Continuity project
33
#
4-
# SPDX-FileCopyrightText: 2023 Stanford University
4+
# SPDX-FileCopyrightText: 2025 Paul Heidekrüger
55
#
66
# SPDX-License-Identifier: MIT
77
#
8-
9-
default_platform(:ios)
10-
118
platform :ios do
129
before_all do
1310
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "5"
@@ -17,22 +14,23 @@ platform :ios do
1714
desc "Build and test"
1815
lane :test do
1916
test_iphone
20-
test_vision_pro
2117
end
2218

2319
desc "Build and test for iPhone"
2420
lane :test_iphone do
2521
private_test(devices: ["iPhone 15 Pro"], result: "iphone")
2622
end
2723

28-
desc "Build and test for Vision Pro"
29-
lane :test_vision_pro do
30-
private_test(devices: ["Apple Vision Pro"], result: "vision_pro")
31-
end
24+
# desc "Build and test for Vision Pro"
25+
# lane :test_vision_pro do
26+
# private_test(devices: ["Apple Vision Pro"], result: "vision_pro")
27+
# end
3228

3329
desc "Internal build and test lane"
3430
private_lane :private_test do |options|
3531
run_tests(
32+
project: "SpatialContinuity.xcodeproj",
33+
scheme: "SpatialContinuityCamera",
3634
skip_build: true,
3735
derived_data_path: ".derivedData",
3836
xcargs: [
@@ -49,13 +47,16 @@ platform :ios do
4947
destination: options[:destination],
5048
result_bundle: true,
5149
output_directory: ".",
52-
result_bundle_path: "./#{options[:result]}.xcresult"
50+
result_bundle_path: "./#{options[:result]}.xcresult",
51+
build_for_testing: true
5352
)
5453
end
5554

5655
desc "CodeQL"
5756
lane :codeql do
5857
build_app(
58+
project: "SpatialContinuity.xcodeproj",
59+
scheme: "SpatialContinuityCamera",
5960
skip_archive: true,
6061
skip_codesigning: true,
6162
derived_data_path: ".derivedData",
@@ -69,14 +70,16 @@ platform :ios do
6970
desc "Build app"
7071
lane :build do
7172
build_app(
73+
project: "SpatialContinuity.xcodeproj",
74+
scheme: "SpatialContinuityCamera",
7275
derived_data_path: ".derivedData",
7376
xcargs: [
7477
"-skipPackagePluginValidation",
7578
"-skipMacroValidation"
7679
],
7780
destination: "generic/platform=iOS",
7881
output_directory: ".build",
79-
archive_path: ".build/TemplateApplication.xcarchive",
82+
archive_path: ".build/SpatialContinuityCamera.xcarchive",
8083
)
8184
# This is an unfortunate workaround for a bug in fastlane: https://github.com/fastlane/fastlane/pull/21319
8285
Dir.chdir("..") do
@@ -85,7 +88,7 @@ platform :ios do
8588
xcodebuild \
8689
-exportArchive \
8790
-exportOptionsPlist ./fastlane/ExportOptions.plist \
88-
-archivePath ./.build/TemplateApplication.xcarchive \
91+
-archivePath ./.build/SpatialContinuityCamera.xcarchive \
8992
-exportPath ./.build
9093
"
9194
)
@@ -113,7 +116,7 @@ platform :ios do
113116
build
114117
commit = last_git_commit
115118
upload_to_testflight(
116-
ipa: "./.build/spatialcontinuity.ipa",
119+
ipa: "./.build/spatialcontinuitycamera.ipa",
117120
distribute_external: true,
118121
groups: [
119122
"External Testers"

0 commit comments

Comments
 (0)