Include iOS workflows (#34)

This commit is contained in:
Katherine Bertelsen 2024-04-17 08:48:25 -05:00 committed by GitHub
parent 63a6240190
commit 01fc8a0d32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 85 additions and 22 deletions

2
.github/CODEOWNERS vendored
View File

@ -8,4 +8,4 @@
* @bitwarden/dept-development-mobile
# DevOps for Actions and other workflow changes
.github/workflows @bitwarden/dept-devops
# .github/workflows @bitwarden/dept-devops

36
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,36 @@
---
name: Build
on:
workflow_dispatch:
inputs:
build-variant:
description: 'Which variant of the app to build'
required: true
type: choice
options:
- Production
build-version:
description: 'Optional. Version string to use, in X.Y.Z format. Overrides default in the project.'
required: false
type: string
build-number:
description: 'Optional. Build number to use. Overrides default of GitHub run number.'
required: false
type: number
env:
build-variant: ${{ inputs.build-variant || 'Production' }}
jobs:
build:
name: Build iOS app
runs-on: macos-13
env:
MINT_PATH: .mint/lib
MINT_LINK_PATH: .mint/bin
steps:
- name: Print Environment
run: |
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"

17
.github/workflows/enforce-labels.yml vendored Normal file
View File

@ -0,0 +1,17 @@
---
name: Enforce PR labels
on:
workflow_call:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
name: Enforce Label
runs-on: ubuntu-22.04
steps:
- name: Enforce Label
uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # 2.2.2
with:
BANNED_LABELS: "hold,needs-qa"
BANNED_LABELS_DESCRIPTION: "PRs with the hold or needs-qa labels cannot be merged"

11
.github/workflows/workflow-linter.yml vendored Normal file
View File

@ -0,0 +1,11 @@
---
name: Workflow Linter
on:
pull_request:
paths:
- .github/workflows/**
jobs:
call-workflow:
uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@main

View File

@ -234,6 +234,11 @@ extension DefaultAppSettingsStore: AppSettingsStore {
set { store(newValue, for: .hasSeenWelcomeTutorial) }
}
var migrationVersion: Int {
get { fetch(for: .migrationVersion) }
set { store(newValue, for: .migrationVersion) }
}
func clearClipboardValue(userId: String) -> ClearClipboardValue {
if let rawValue: Int = fetch(for: .clearClipboardValue(userId: userId)),
let value = ClearClipboardValue(rawValue: rawValue) {
@ -243,12 +248,7 @@ extension DefaultAppSettingsStore: AppSettingsStore {
}
func secretKey(userId: String) -> String? {
return fetch(for: .secretKey(userId: userId))
}
var migrationVersion: Int {
get { fetch(for: .migrationVersion) }
set { store(newValue, for: .migrationVersion) }
fetch(for: .secretKey(userId: userId))
}
func setClearClipboardValue(_ clearClipboardValue: ClearClipboardValue?, userId: String) {

View File

@ -54,6 +54,4 @@ class AuthenticatorItemRepositoryTests: AuthenticatorTestCase {
try await subject.addAuthenticatorItem(.fixture())
}
}
// TODO: Backfill tests
}

View File

@ -56,7 +56,6 @@ protocol AuthenticatorItemService {
class DefaultAuthenticatorItemService {
// MARK: Properties
// TODO: Generate this user ID and store it in the keychain?
private let defaultUserId = "local"
/// The data store for persisted items

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 KiB

After

Width:  |  Height:  |  Size: 654 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -60,7 +60,10 @@ class AuthenticatorItemCoordinator: NSObject, Coordinator, HasStackNavigator {
})
case let .editAuthenticatorItem(authenticatorItemView):
Logger.application.log("Edit item \(authenticatorItemView.id)")
showEditAuthenticatorItem(for: authenticatorItemView, delegate: context as? AuthenticatorItemOperationDelegate)
showEditAuthenticatorItem(
for: authenticatorItemView,
delegate: context as? AuthenticatorItemOperationDelegate
)
}
}

View File

@ -26,10 +26,12 @@ final class ManualEntryProcessorTests: AuthenticatorTestCase {
}
/// `receive()` with `.addPressed(:)` navigates to `.addManual(:)`.
// func test_receive_addPressed() async {
// subject.receive(.addPressed(code: "YouNeedUniqueNewYork", name: "NewYork"))
// XCTAssertEqual(coordinator.routes, [.addManual(key: "YouNeedUniqueNewYork", name: "NewYork")])
// }
func test_receive_addPressed() async {
subject.state.authenticatorKey = "YouNeedUniqueNewYork"
subject.state.name = "NewYork"
subject.receive(.addPressed(code: "YouNeedUniqueNewYork", name: "NewYork"))
XCTAssertEqual(coordinator.routes, [.addManual(key: "YouNeedUniqueNewYork", name: "NewYork")])
}
/// `receive()` with `.authenticatorKeyChanged(:)` updates the state.
func test_receive_authenticatorKeyChanged() async {

View File

@ -1,15 +1,12 @@
xcode_summary.ignored_files = '**/SourcePackages/*'
xcode_summary.report 'build/BitwardenTests.xcresult'
xcode_summary.report 'build/SuthenticatorTests.xcresult'
slather.configure(
'Bitwarden.xcodeproj', 'Bitwarden',
'Authenticator.xcodeproj', 'Authenticator',
options: {
binary_basename: [
'Bitwarden',
#'BitwardenActionExtension', -- Can't add this until the target has some lines of code or slather throws an error.
'BitwardenAutoFillExtension',
'BitwardenShareExtension',
'BitwardenShared',
'Authenticator',
'BitwardenAuthenticatorShared',
'Networking',
],
build_directory: 'build/DerivedData',