-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9d80fa0
Showing
178 changed files
with
20,572 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: iOS starter workflow | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
name: Build and Archive App | ||
runs-on: macos-13 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set Xcode Version | ||
run: sudo xcode-select -s /Applications/Xcode_15.0.app | ||
|
||
- name: Get App Store Connect API Key File | ||
env: | ||
ASCAPI_KEY: ${{ secrets.ASCAPI_KEY }} | ||
run: | | ||
KEY_PATH=$RUNNER_TEMP/ascapi-key.p8 | ||
echo -n "$ASCAPI_KEY" > $KEY_PATH | ||
- name: Resolve Swift dependencies | ||
run: | | ||
xcodebuild -resolvePackageDependencies -scheme DarockBili -configuration Debug | ||
xcodebuild -resolvePackageDependencies -scheme DarockBili -configuration Release | ||
- name: Archive DarockBili App | ||
env: | ||
ASCAPI_KEY_ID: ${{ secrets.ASCAPI_KEY_ID }} | ||
ASCAPI_ISSUER_ID: ${{ secrets.ASCAPI_ISSUER_ID }} | ||
run: | | ||
KEY_PATH=$RUNNER_TEMP/ascapi-key.p8 | ||
xcodebuild -scheme DarockBili -configuration Debug DEVELOPMENT_TEAM=B57D8PP775 -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath DarockBili_Debug.xcarchive clean archive CODE_SIGN_IDENTITY="Apple Development" -allowProvisioningUpdates -authenticationKeyPath $KEY_PATH -authenticationKeyID $ASCAPI_KEY_ID -authenticationKeyIssuerID $ASCAPI_ISSUER_ID | ||
xcodebuild -scheme DarockBili -configuration Release DEVELOPMENT_TEAM=B57D8PP775 -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath DarockBili_Release.xcarchive clean archive CODE_SIGN_IDENTITY="Apple Development" -allowProvisioningUpdates -authenticationKeyPath $KEY_PATH -authenticationKeyID $ASCAPI_KEY_ID -authenticationKeyIssuerID $ASCAPI_ISSUER_ID | ||
- name: Export IPA | ||
run: | | ||
mkdir ./Export_Debug | ||
mkdir ./Export_Release | ||
xcodebuild -exportArchive -archivePath DarockBili_Debug.xcarchive -exportPath ./Export_Debug -exportOptionsPlist ExportOptions.plist | ||
xcodebuild -exportArchive -archivePath DarockBili_Release.xcarchive -exportPath ./Export_Release -exportOptionsPlist ExportOptions.plist | ||
- name: Upload Debug IPA | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Debug.ipa | ||
path: ./Export_Debug/DarockBili.ipa | ||
|
||
- name: Upload Release IPA | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Release.ipa | ||
path: ./Export_Release/DarockBili.ipa | ||
|
55 changes: 55 additions & 0 deletions
55
DarockBili Watch App UI Tests/DarockBili_Watch_App_UI_Tests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// DarockBili_Watch_App_UI_Tests.swift | ||
// DarockBili Watch App UI Tests | ||
// | ||
// Created by WindowsMEMZ on 2023/7/27. | ||
// | ||
|
||
import XCTest | ||
|
||
final class DarockBili_Watch_App_UI_Tests: XCTestCase { | ||
|
||
override func setUpWithError() throws { | ||
// Put setup code here. This method is called before the invocation of each test method in the class. | ||
|
||
// In UI tests it is usually best to stop immediately when a failure occurs. | ||
continueAfterFailure = false | ||
|
||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
func testAppMain() throws { | ||
// UI tests must launch the application that they test. | ||
let app = XCUIApplication() | ||
app.launch() | ||
continueAfterFailure = true | ||
if app.staticTexts["Debug"].exists { | ||
XCTAssertTrue(app.staticTexts["Debug"].exists, "Debug Mode Not Closed") | ||
app.buttons["Debug"].tap() | ||
XCTAssertFalse(app.staticTexts["Text"].waitForExistence(timeout: 2.5), "No Tip Window") | ||
app.buttons["Show Debug Controls"].tap() | ||
XCTAssertFalse(app.staticTexts["Memory Usage:"].exists, "Debug - Memory Usage Label?") | ||
app.buttons["Close Debug Controls"].tap() | ||
} | ||
continueAfterFailure = false | ||
XCTAssertFalse(app.staticTexts["TestVideoCard"].waitForExistence(timeout: 7), "Could not load any video") | ||
app.buttons["TestVideoCard"].tap() | ||
app.buttons["OwnerPage"].tap() | ||
sleep(5) | ||
app.swipeLeft() | ||
sleep(5) | ||
} | ||
|
||
func testLaunchPerformance() throws { | ||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { | ||
// This measures how long it takes to launch your application. | ||
measure(metrics: [XCTApplicationLaunchMetric()]) { | ||
XCUIApplication().launch() | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
DarockBili Watch App UI Tests/DarockBili_Watch_App_UI_TestsLaunchTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// DarockBili_Watch_App_UI_TestsLaunchTests.swift | ||
// DarockBili Watch App UI Tests | ||
// | ||
// Created by WindowsMEMZ on 2023/7/27. | ||
// | ||
|
||
import XCTest | ||
|
||
final class DarockBili_Watch_App_UI_TestsLaunchTests: XCTestCase { | ||
|
||
override class var runsForEachTargetApplicationUIConfiguration: Bool { | ||
true | ||
} | ||
|
||
override func setUpWithError() throws { | ||
continueAfterFailure = false | ||
} | ||
|
||
func testLaunch() throws { | ||
let app = XCUIApplication() | ||
app.launch() | ||
|
||
// Insert steps here to perform after app launch but before taking a screenshot, | ||
// such as logging into a test account or navigating somewhere in the app | ||
|
||
let attachment = XCTAttachment(screenshot: app.screenshot()) | ||
attachment.name = "Launch Screen" | ||
attachment.lifetime = .keepAlways | ||
add(attachment) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
DarockBili Watch App UI Tests/WatchAppUITestPlan.xctestplan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"configurations" : [ | ||
{ | ||
"id" : "D07F2214-DD84-4367-91E2-739AD4D49938", | ||
"name" : "Configuration 1", | ||
"options" : { | ||
|
||
} | ||
} | ||
], | ||
"defaultOptions" : { | ||
"testTimeoutsEnabled" : true | ||
}, | ||
"testTargets" : [ | ||
{ | ||
"target" : { | ||
"containerPath" : "container:DarockBili.xcodeproj", | ||
"identifier" : "6BA20BD12A7185D300AAD0C7", | ||
"name" : "DarockBili Watch App UI Tests" | ||
} | ||
} | ||
], | ||
"version" : 1 | ||
} |
38 changes: 38 additions & 0 deletions
38
DarockBili Watch App Unit Tests/DarockBili_Watch_App_Unit_Tests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// DarockBili_Watch_App_Unit_Tests.swift | ||
// DarockBili Watch App Unit Tests | ||
// | ||
// Created by WindowsMEMZ on 2023/7/27. | ||
// | ||
|
||
import XCTest | ||
import DarockKit | ||
|
||
final class DarockBili_Watch_App_Unit_Tests: XCTestCase { | ||
|
||
override func setUpWithError() throws { | ||
// Put setup code here. This method is called before the invocation of each test method in the class. | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
func testDarockApiBase() throws { | ||
DarockKit.Network.shared.requestString("https://api.darock.top") { respStr, isSuccess in | ||
if isSuccess { | ||
XCTAssert(respStr == "\"OK\"", "Darock API 返回错误") | ||
} else { | ||
XCTAssert(false, "无法连接到 Darock API") | ||
} | ||
} | ||
} | ||
|
||
// func testPerformanceExample() throws { | ||
// // This is an example of a performance test case. | ||
// measure { | ||
// // Put the code you want to measure the time of here. | ||
// } | ||
// } | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
DarockBili Watch App Unit Tests/WatchAppUnitTestPlan.xctestplan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"configurations" : [ | ||
{ | ||
"id" : "D07F2214-DD84-4367-91E2-739AD4D49938", | ||
"name" : "Configuration 1", | ||
"options" : { | ||
|
||
} | ||
} | ||
], | ||
"defaultOptions" : { | ||
"testTimeoutsEnabled" : true | ||
}, | ||
"testTargets" : [ | ||
{ | ||
"target" : { | ||
"containerPath" : "container:DarockBili.xcodeproj", | ||
"identifier" : "6BA20BC42A7185B100AAD0C7", | ||
"name" : "DarockBili Watch App Unit Tests" | ||
} | ||
} | ||
], | ||
"version" : 1 | ||
} |
Binary file not shown.
20 changes: 20 additions & 0 deletions
20
DarockBili Watch App/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0.729", | ||
"green" : "0.537", | ||
"red" : "0.973" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
DarockBili Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "未标题-2.png", | ||
"idiom" : "universal", | ||
"platform" : "watchos", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
DarockBili Watch App/Assets.xcassets/Coin1Icon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "coin1.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "coin1 1.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "coin1 2.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
DarockBili Watch App/Assets.xcassets/Coin2Icon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "coin2 2.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "coin2.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "coin2 1.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
DarockBili Watch App/Assets.xcassets/Lv0Icon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "lv0.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "lv0 2.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "lv0 1.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
DarockBili Watch App/Assets.xcassets/Lv1Icon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "lv1_1.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "lv1_1 2.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "lv1_1 1.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.