Include iOS workflows (#34)
2
.github/CODEOWNERS
vendored
@ -8,4 +8,4 @@
|
|||||||
* @bitwarden/dept-development-mobile
|
* @bitwarden/dept-development-mobile
|
||||||
|
|
||||||
# DevOps for Actions and other workflow changes
|
# 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
@ -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
@ -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
@ -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
|
||||||
@ -234,6 +234,11 @@ extension DefaultAppSettingsStore: AppSettingsStore {
|
|||||||
set { store(newValue, for: .hasSeenWelcomeTutorial) }
|
set { store(newValue, for: .hasSeenWelcomeTutorial) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var migrationVersion: Int {
|
||||||
|
get { fetch(for: .migrationVersion) }
|
||||||
|
set { store(newValue, for: .migrationVersion) }
|
||||||
|
}
|
||||||
|
|
||||||
func clearClipboardValue(userId: String) -> ClearClipboardValue {
|
func clearClipboardValue(userId: String) -> ClearClipboardValue {
|
||||||
if let rawValue: Int = fetch(for: .clearClipboardValue(userId: userId)),
|
if let rawValue: Int = fetch(for: .clearClipboardValue(userId: userId)),
|
||||||
let value = ClearClipboardValue(rawValue: rawValue) {
|
let value = ClearClipboardValue(rawValue: rawValue) {
|
||||||
@ -243,12 +248,7 @@ extension DefaultAppSettingsStore: AppSettingsStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func secretKey(userId: String) -> String? {
|
func secretKey(userId: String) -> String? {
|
||||||
return fetch(for: .secretKey(userId: userId))
|
fetch(for: .secretKey(userId: userId))
|
||||||
}
|
|
||||||
|
|
||||||
var migrationVersion: Int {
|
|
||||||
get { fetch(for: .migrationVersion) }
|
|
||||||
set { store(newValue, for: .migrationVersion) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setClearClipboardValue(_ clearClipboardValue: ClearClipboardValue?, userId: String) {
|
func setClearClipboardValue(_ clearClipboardValue: ClearClipboardValue?, userId: String) {
|
||||||
|
|||||||
@ -54,6 +54,4 @@ class AuthenticatorItemRepositoryTests: AuthenticatorTestCase {
|
|||||||
try await subject.addAuthenticatorItem(.fixture())
|
try await subject.addAuthenticatorItem(.fixture())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Backfill tests
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,7 +56,6 @@ protocol AuthenticatorItemService {
|
|||||||
class DefaultAuthenticatorItemService {
|
class DefaultAuthenticatorItemService {
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
// TODO: Generate this user ID and store it in the keychain?
|
|
||||||
private let defaultUserId = "local"
|
private let defaultUserId = "local"
|
||||||
|
|
||||||
/// The data store for persisted items
|
/// The data store for persisted items
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 637 KiB After Width: | Height: | Size: 654 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 76 KiB |
@ -60,7 +60,10 @@ class AuthenticatorItemCoordinator: NSObject, Coordinator, HasStackNavigator {
|
|||||||
})
|
})
|
||||||
case let .editAuthenticatorItem(authenticatorItemView):
|
case let .editAuthenticatorItem(authenticatorItemView):
|
||||||
Logger.application.log("Edit item \(authenticatorItemView.id)")
|
Logger.application.log("Edit item \(authenticatorItemView.id)")
|
||||||
showEditAuthenticatorItem(for: authenticatorItemView, delegate: context as? AuthenticatorItemOperationDelegate)
|
showEditAuthenticatorItem(
|
||||||
|
for: authenticatorItemView,
|
||||||
|
delegate: context as? AuthenticatorItemOperationDelegate
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,10 +26,12 @@ final class ManualEntryProcessorTests: AuthenticatorTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// `receive()` with `.addPressed(:)` navigates to `.addManual(:)`.
|
/// `receive()` with `.addPressed(:)` navigates to `.addManual(:)`.
|
||||||
// func test_receive_addPressed() async {
|
func test_receive_addPressed() async {
|
||||||
// subject.receive(.addPressed(code: "YouNeedUniqueNewYork", name: "NewYork"))
|
subject.state.authenticatorKey = "YouNeedUniqueNewYork"
|
||||||
// XCTAssertEqual(coordinator.routes, [.addManual(key: "YouNeedUniqueNewYork", name: "NewYork")])
|
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.
|
/// `receive()` with `.authenticatorKeyChanged(:)` updates the state.
|
||||||
func test_receive_authenticatorKeyChanged() async {
|
func test_receive_authenticatorKeyChanged() async {
|
||||||
|
|||||||
11
Dangerfile
@ -1,15 +1,12 @@
|
|||||||
xcode_summary.ignored_files = '**/SourcePackages/*'
|
xcode_summary.ignored_files = '**/SourcePackages/*'
|
||||||
xcode_summary.report 'build/BitwardenTests.xcresult'
|
xcode_summary.report 'build/SuthenticatorTests.xcresult'
|
||||||
|
|
||||||
slather.configure(
|
slather.configure(
|
||||||
'Bitwarden.xcodeproj', 'Bitwarden',
|
'Authenticator.xcodeproj', 'Authenticator',
|
||||||
options: {
|
options: {
|
||||||
binary_basename: [
|
binary_basename: [
|
||||||
'Bitwarden',
|
'Authenticator',
|
||||||
#'BitwardenActionExtension', -- Can't add this until the target has some lines of code or slather throws an error.
|
'BitwardenAuthenticatorShared',
|
||||||
'BitwardenAutoFillExtension',
|
|
||||||
'BitwardenShareExtension',
|
|
||||||
'BitwardenShared',
|
|
||||||
'Networking',
|
'Networking',
|
||||||
],
|
],
|
||||||
build_directory: 'build/DerivedData',
|
build_directory: 'build/DerivedData',
|
||||||
|
|||||||