Skip to content
Open
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
32 changes: 27 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ concurrency:
jobs:
mhc_app_unit_tests:
name: App Unit Tests
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/xcodebuild.yml@lukas/fix-artifacts
permissions:
contents: read
with:
runsonlabels: '["macOS", "self-hosted"]'
scheme: MyHeartCounts
Expand All @@ -29,7 +31,7 @@ jobs:
artifactname: MHC-App-UnitTests.xcresult
mhc_app_ui_tests:
name: App UI Tests
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/xcodebuild-or-fastlane.yml@lukas/fix-artifacts
permissions:
contents: read
with:
Expand All @@ -40,9 +42,25 @@ jobs:
customcommand: "cd ./MyHeartCounts-Firebase && npm install && npm run prepare && firebase emulators:exec 'cd .. && fastlane uitest'"
secrets:
GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_BASE64 }}

# mhc_app_ui_tests:
# name: App UI Tests
# uses: SchmiedmayerLab/.github/.github/workflows/firebase-emulators-exec.yml@lukas/fix-artifacts
# permissions:
# contents: read
# with:
# runs_on_labels: '["macOS", "self-hosted"]'
# path: MyHeartCounts-Firebase
# checkout_submodules: true
# artifact: ../MHC-App-UITests.xcresult
# command: npm run prepare && cd .. && fastlane uitest
# secrets:
# GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_BASE64 }}
mhc_utils_unit_tests:
name: Utils Unit Tests (${{ matrix.platform.name }} ${{ matrix.config }})
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/xcodebuild.yml@lukas/fix-artifacts
permissions:
contents: read
strategy:
matrix:
config: [Debug, Release]
Expand All @@ -51,6 +69,7 @@ jobs:
destination: 'platform=iOS Simulator,name=iPhone 17 Pro'
- name: macOS
destination: 'platform=macOS,arch=arm64'
fail-fast: false
with:
runsonlabels: '["macOS", "self-hosted"]'
path: MyHeartCountsShared
Expand All @@ -60,7 +79,9 @@ jobs:
artifactname: ${{ format('MHC-Shared-UnitTests-{0}-{1}.xcresult', matrix.platform.name, matrix.config) }}
mhc_utils_unit_tests_linux:
name: Utils Unit Tests (Linux ${{ matrix.config }})
uses: StanfordBDHG/.github/.github/workflows/swift-test.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/swift-test.yml@lukas/fix-artifacts
permissions:
contents: read
strategy:
matrix:
config: [Debug, Release]
Expand All @@ -71,8 +92,9 @@ jobs:
uploadcoveragereport:
name: Upload Coverage Report
needs: [mhc_app_unit_tests, mhc_app_ui_tests, mhc_utils_unit_tests, mhc_utils_unit_tests_linux]
uses: StanfordBDHG/.github/.github/workflows/create-and-upload-coverage-report.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/coverage.yml@lukas/fix-artifacts
permissions:
actions: read
contents: read
with:
coveragereports: MHC-*.xcresult
Expand Down
37 changes: 25 additions & 12 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ jobs:
environment: ${{ steps.determineenvironment.outputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Determine Environment
id: determineenvironment
run: |
if [[ -z "${{ inputs.environment }}" ]]; then
echo "environment=staging" >> $GITHUB_OUTPUT
echo "environment=staging" >> "$GITHUB_OUTPUT"
echo "environment: staging"
else
echo "environment=${{ inputs.environment }}" >> $GITHUB_OUTPUT
echo "environment=${{ inputs.environment }}" >> "$GITHUB_OUTPUT"
echo "environment: ${{ inputs.environment }}"
fi
vars:
Expand All @@ -96,7 +96,7 @@ jobs:
version: ${{ steps.script.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
with:
Expand All @@ -111,10 +111,10 @@ jobs:
PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"

echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
echo "version: $NEW_VERSION"
else
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
echo "version: ${{ inputs.version }}"
fi
echo "buildnumber: ${{ inputs.buildnumber }}"
Expand All @@ -129,13 +129,26 @@ jobs:
testflight:
name: iOS App TestFlight Deployment
needs: [determineenvironment, vars, test]
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/xcode-deploy.yml@lukas/fix-artifacts
permissions:
Comment thread
PSchmiedmayer marked this conversation as resolved.
contents: read
with:
runsonlabels: '["macOS", "self-hosted"]'
runs_on_labels: '["macOS", "self-hosted"]'
environment: ${{ needs.determineenvironment.outputs.environment }}
googleserviceinfoplistpath: 'MyHeartCounts/Supporting Files/GoogleService-Info.plist'
setupsigning: true
fastlanelane: deploy environment:"${{ needs.determineenvironment.outputs.environment }}" versionname:"${{ needs.vars.outputs.version }}" releasenotes:"${{ inputs.releasenotes }}" ${{ inputs.buildnumber && format('buildnumber:"{0}"', inputs.buildnumber) || '' }} strip_sensorkit_entitlement:false
secrets: inherit
injected_secret_file_path: 'MyHeartCounts/Supporting Files/GoogleService-Info.plist'
setup_signing: true
command: >-
fastlane deploy environment:"${{ needs.determineenvironment.outputs.environment }}"
versionname:"${{ needs.vars.outputs.version }}" releasenotes:"${{ inputs.releasenotes }}"
${{ inputs.buildnumber && format('buildnumber:"{0}"', inputs.buildnumber) || '' }}
strip_sensorkit_entitlement:false
Comment thread
PSchmiedmayer marked this conversation as resolved.
secrets:
APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }}
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
BUILD_SECONDARY_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_SECONDARY_PROVISION_PROFILE_BASE64 }}
INJECTED_SECRET_FILE_BASE64: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ on:
jobs:
markdown_link_check:
name: Markdown Link Check
uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/markdown-links.yml@lukas/fix-artifacts
permissions:
contents: read
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ concurrency:
jobs:
formatreleasenotes:
name: Format Release Notes
uses: StanfordBDHG/.github/.github/workflows/format-release-notes.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/format-release-notes.yml@lukas/fix-artifacts
permissions:
Comment thread
PSchmiedmayer marked this conversation as resolved.
contents: read
with:
release-tag: ${{ github.event.release.tag_name }}
repository: ${{ github.repository }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,36 @@ concurrency:
jobs:
reuse_action:
name: REUSE Compliance Check
uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/reuse.yml@lukas/fix-artifacts
permissions:
contents: read
swiftlint:
name: SwiftLint
uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/swiftlint.yml@lukas/fix-artifacts
permissions:
contents: read
periphery:
name: Periphery
uses: StanfordBDHG/.github/.github/workflows/periphery.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/periphery.yml@lukas/fix-artifacts
permissions:
contents: read
with:
runsonlabels: '["macOS", "self-hosted"]'
strict: false
markdownlinkcheck:
name: Markdown Link Check
uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/markdown-links.yml@lukas/fix-artifacts
permissions:
contents: read
codeql:
name: CodeQL
uses: StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
uses: SchmiedmayerLab/.github/.github/workflows/xcodebuild.yml@lukas/fix-artifacts
permissions:
security-events: write
actions: read
contents: read
with:
codeql: true
fastlanelane: codeql
scheme: MyHeartCounts
test: false
xcodeversion: 26.4
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "MyHeartCounts-Firebase"]
path = MyHeartCounts-Firebase
url = https://github.com/StanfordBDHG/MyHeartCounts-Firebase.git
url = https://github.com/SchmiedmayerLab/MyHeartCounts-Firebase.git
[submodule "MyHeartCounts-StudyDefinitions"]
path = MyHeartCounts-StudyDefinitions
url = https://github.com/StanfordBDHG/MyHeartCounts-StudyDefinitions.git
url = https://github.com/SchmiedmayerLab/MyHeartCounts-StudyDefinitions.git
10 changes: 5 additions & 5 deletions MyHeartCounts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,8 @@
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.MyHeartCounts;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "My Heart Counts - Biodesign Digital Health";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "My Heart Counts - Biodesign Digital Health";
PROVISIONING_PROFILE_SPECIFIER = "My Heart Counts";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "My Heart Counts";
Comment thread
PSchmiedmayer marked this conversation as resolved.
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand Down Expand Up @@ -1179,8 +1179,8 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.MyHeartCounts.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "My Heart Counts - Biodesign Digital Health - Watch";
"PROVISIONING_PROFILE_SPECIFIER[sdk=watchos*]" = "My Heart Counts - Biodesign Digital Health - Watch";
PROVISIONING_PROFILE_SPECIFIER = "My Heart Counts - Watch";
"PROVISIONING_PROFILE_SPECIFIER[sdk=watchos*]" = "My Heart Counts - Watch";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -1353,7 +1353,7 @@
};
804C11E22ECA380D004783C3 /* XCRemoteSwiftPackageReference "MyHeartCounts-StudyDefinitions" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordBDHG/MyHeartCounts-StudyDefinitions.git";
repositoryURL = "https://github.com/SchmiedmayerLab/MyHeartCounts-StudyDefinitions.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.1.16;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:MyHeartCountsTests/MyHeartCounts Unit Tests.xctestplan"
default = "YES">
reference = "container:MyHeartCountsTests/MyHeartCounts Unit Tests.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:MyHeartCountsUITests/MyHeartCounts UI Tests.xctestplan">
reference = "container:MyHeartCountsUITests/MyHeartCounts UI Tests.xctestplan"
default = "YES">
</TestPlanReference>
<TestPlanReference
reference = "container:MyHeartCountsUITests/MyHeartCounts Screenshots.xctestplan">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extension HomeTab {
lastResult = await Result {
try await handler(spezi)
}
return try lastResult!.get() // swiftlint:disable:this force_unwrapping return_value_from_void_function
try lastResult!.get() // swiftlint:disable:this force_unwrapping
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion MyHeartCounts/Modules/ClinicalRecordPermissions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

/// Whether clinical records are available.
static var isAvailable: Bool = !FeatureFlags.disableHealthRecords && HKHealthStore().supportsHealthRecords()
static let isAvailable: Bool = !FeatureFlags.disableHealthRecords && HKHealthStore().supportsHealthRecords()

Check warning on line 29 in MyHeartCounts/Modules/ClinicalRecordPermissions.swift

View workflow job for this annotation

GitHub Actions / CodeQL / Build and Test with xcodebuild

'disableHealthRecords' is deprecated: renamed to 'enableHealthRecords'

Check warning on line 29 in MyHeartCounts/Modules/ClinicalRecordPermissions.swift

View workflow job for this annotation

GitHub Actions / CodeQL / Build and Test with xcodebuild

'disableHealthRecords' is deprecated: renamed to 'enableHealthRecords'

Check warning on line 29 in MyHeartCounts/Modules/ClinicalRecordPermissions.swift

View workflow job for this annotation

GitHub Actions / App Unit Tests / Build and Test with xcodebuild

'disableHealthRecords' is deprecated: renamed to 'enableHealthRecords'

Check warning on line 29 in MyHeartCounts/Modules/ClinicalRecordPermissions.swift

View workflow job for this annotation

GitHub Actions / App Unit Tests / Build and Test with xcodebuild

'disableHealthRecords' is deprecated: renamed to 'enableHealthRecords'

// swiftlint:disable attributes
@ObservationIgnored @Dependency(HealthKit.self) private var healthKit
Expand Down
4 changes: 2 additions & 2 deletions MyHeartCounts/Modules/StudyBundleLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ final class StudyBundleLoader: Module, Sendable {
case (.none, _), (.some(.failure), _):
value = newValue
return .changed(newValue)
case (.some(.success(let oldBundle)), .success(let newBundle)):
case let (.some(.success(oldBundle)), .success(newBundle)):
if newBundle != oldBundle {
value = .success(newBundle)
return .changed(.success(newBundle))
} else {
return .unchanged(.success(oldBundle))
}
case (.some(.success(let oldBundle)), .failure):
case let (.some(.success(oldBundle)), .failure):
if preferCachedBundleOnError {
// in this case (we successfully obtained a study bundle before, but it now has failed),
// we keep the old bundle around instead of updating `_studyBundle` with the error case.
Expand Down
11 changes: 7 additions & 4 deletions MyHeartCounts/SharedContext/FeatureFlags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ enum FeatureFlags {
LaunchOptions.launchOptions[.overrideFirebaseConfig]
}

/// Whether Health-Record-related functionality should be disabled.
/// Whether Health-Record-related functionality should be enabled.
static var enableHealthRecords: Bool {
LaunchOptions.launchOptions[.enableHealthRecords]
}

@available(*, deprecated, renamed: "enableHealthRecords")
static var disableHealthRecords: Bool {
LaunchOptions.launchOptions[.disableHealthRecords]
!enableHealthRecords
}
}

Expand All @@ -55,6 +60,4 @@ extension LaunchOptions {
static let disableAutomaticBulkHealthExport = LaunchOption<Bool>("--disableAutomaticBulkHealthExport", default: false)

static let disableSensorKitUpload = LaunchOption<Bool>("--disableSensorKitUpload", default: false)

static let disableHealthRecords = LaunchOption<Bool>("--disableHealthRecords", default: false)
}
3 changes: 2 additions & 1 deletion MyHeartCountsShared/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ packageDeps += [
.package(url: "https://github.com/SFSafeSymbols/SFSafeSymbols.git", from: "7.0.0"),
// not actually used but we need to force the version until we update SpeziStudy
.package(url: "https://github.com/StanfordSpezi/SpeziStorage.git", from: "2.1.4"),
.package(url: "https://github.com/StanfordSpezi/SpeziScheduler.git", from: "1.2.20")
.package(url: "https://github.com/StanfordSpezi/SpeziScheduler.git", from: "1.2.20"),
.package(url: "https://github.com/apple/FHIRModels.git", .upToNextMinor(from: "0.8.0"))
]
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ extension Bool: LaunchOptionDecodable, LaunchOptionEncodable {
}

public func launchOptionArgs(for launchOption: LaunchOption<Bool>) -> [String] {
self ? [launchOption.key] : []
if self {
[launchOption.key, "true"]
} else {
[launchOption.key, "false"]
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ extension LaunchOptions {
///
/// - Note: Specifying `false` for this option when the account key is `true` will not force-disable the debug mode.
public static let forceEnableDebugMode = LaunchOption<Bool>("--forceEnableDebugMode", default: false)


/// Whether the app should enable its HealthKit Clinical Records integration
public static let enableHealthRecords = LaunchOption<Bool>("--enableHealthRecords", default: true)
}

#endif
4 changes: 3 additions & 1 deletion MyHeartCountsUITests/AOnboardingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,11 @@ struct OnboardingNavigator { // swiftlint:disable:this type_body_length


private func navigateHealthRecords() {
XCTAssert(app.staticTexts["Health Records"].waitForExistence(timeout: 2))
let title = app.staticTexts["Health Records"]
XCTAssert(title.waitForExistence(timeout: 2))
app.buttons["Review Permissions"].tap()
testCase.handleHealthRecordsAuthorization()
XCTAssert(title.waitForNonExistence(timeout: 10)) // give it some time to complete the auth
}


Expand Down
2 changes: 1 addition & 1 deletion MyHeartCountsUITests/BasicAppUsage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@

@MainActor
func testWithdrawal() throws {
throw XCTSkip("needs https://github.com/StanfordBDHG/MyHeartCounts-Firebase/pull/111")
throw XCTSkip("needs https://github.com/SchmiedmayerLab/MyHeartCounts-Firebase/pull/111")
try launchAppAndEnrollIntoStudy(locale: .enUS)

Check warning on line 97 in MyHeartCountsUITests/BasicAppUsage.swift

View workflow job for this annotation

GitHub Actions / App Unit Tests / Build and Test with xcodebuild

code after 'throw' will never be executed
openAccountSheet()
app.swipeUp()
app.navigationBars.buttons["Edit"].tap()
Expand Down
Loading
Loading