-
Notifications
You must be signed in to change notification settings - Fork 12
73 lines (58 loc) · 2.73 KB
/
ios.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Meowbili iDevice Workflow
on:
push:
branches: [ "main" ]
paths-ignore:
- '.github/workflows/codeql.yml'
pull_request:
branches: [ "main" ]
paths-ignore:
- '.github/workflows/codeql.yml'
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: Archive DarockBili App
run: |
xcodebuild -scheme 'DarockBili Watch App' -configuration Debug -archivePath DarockBili_Debug.xcarchive clean archive CODE_SIGN_IDENTITY=""
xcodebuild -scheme 'DarockBili Watch App' -configuration Release -archivePath DarockBili_Release.xcarchive clean archive CODE_SIGN_IDENTITY=""
- name: Upload Debug Archive
uses: actions/upload-artifact@v3
with:
name: Debug XCArchive
path: ./DarockBili_Debug.xcarchive
- name: Upload Release Archive
uses: actions/upload-artifact@v3
with:
name: Release XCArchive
path: ./DarockBili_Release.xcarchive
build_for_testing:
runs-on: macos-13
name: Test App
steps:
- uses: actions/checkout@v3
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Resolve Swift dependencies
run: xcodebuild -resolvePackageDependencies -scheme 'DarockBili Watch App' -configuration Release
- name: Prepare Cache Folder
run: mkdir Caches
- name: Build and Test
run: xcodebuild test -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App' -configuration Release -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (41mm),OS=10.0' -destination 'platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=10.0' -testPlan WatchAppUITestPlan -testProductsPath ./Caches/TestProducts.xctestproducts -derivedDataPath ./Caches/DerivedData | tee TestBuilding.log
- name: Upload Building Log
uses: actions/upload-artifact@v3
with:
name: Watch Testing Log
path: ./TestBuilding.log
- name: Rename Test Attachments
run: for file in ./Caches/DerivedData/Logs/Test/Test-*.xcresult/Data/*; do if [ ! -f "$file" ]; then continue; fi; file_type=$(file -b --mime-type "$file"); extension=""; case "$file_type" in "image/jpeg" | "image/jpg") extension=".jpg";; "image/png") extension=".png";; "text/plain") extension=".txt";; *) extension=".dat";; esac; mv "$file" "$file$extension"; done
- name: Upload Test Attachments
uses: actions/upload-artifact@v3
with:
name: Test Attachments
path: ./Caches/DerivedData/Logs/Test