|
| 1 | +# test.yml |
| 2 | +# Unit Test |
1 | 3 | name: Unit Test
|
2 |
| - |
3 |
| -on: |
| 4 | +'on': |
4 | 5 | pull_request:
|
5 | 6 | paths:
|
6 |
| - - "**.swift" |
7 |
| - - "**.xcodeproj" |
8 |
| - - "**.m" |
9 |
| - - "**.h" |
10 |
| - - "**.podspec" |
11 |
| - - "Podfile" |
12 |
| - - "Podfile.lock" |
13 |
| - - "test.yml" |
| 7 | + - '**.swift' |
| 8 | + - '**.xcodeproj' |
| 9 | + - '**.m' |
| 10 | + - '**.h' |
| 11 | + - '**.podspec' |
| 12 | + - Podfile |
| 13 | + - Podfile.lock |
| 14 | + - '**/test.yml' |
14 | 15 | jobs:
|
15 | 16 | swiftpm:
|
16 | 17 | name: Test iOS (swiftpm)
|
17 | 18 | runs-on: macOS-latest
|
18 | 19 | env:
|
19 |
| - DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer |
| 20 | + DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer |
20 | 21 | steps:
|
21 | 22 | - name: Checkout
|
22 | 23 | uses: actions/checkout@master
|
23 | 24 | - name: iOS - Swift PM
|
24 | 25 | run: |
|
25 | 26 | pod install
|
26 | 27 | set -o pipefail && swift test --parallel
|
27 |
| - iOS: |
| 28 | + XCode: |
28 | 29 | name: Test iOS
|
29 | 30 | runs-on: macOS-latest
|
30 | 31 | env:
|
31 |
| - DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer |
| 32 | + DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer |
32 | 33 | strategy:
|
33 |
| - matrix: |
34 |
| - destination: [ |
35 |
| - 'platform=iOS Simulator,OS=14.4,name=iPhone 12' |
36 |
| - ] |
| 34 | + matrix: |
| 35 | + run-config: |
| 36 | + - scheme: Hero |
| 37 | + platform: iOS |
| 38 | + action: test |
| 39 | + code-coverage: true |
| 40 | + - scheme: Hero (tvOS) |
| 41 | + platform: tvOS |
| 42 | + action: build |
| 43 | + code-coverage: false |
37 | 44 | steps:
|
38 | 45 | - name: Checkout
|
39 | 46 | uses: actions/checkout@master
|
40 | 47 |
|
41 |
| - - name: iOS - ${{ matrix.destination }} |
| 48 | + - name: CocoaPods - ${{ matrix.run-config.destination }} |
42 | 49 | run: |
|
43 | 50 | pod install
|
44 |
| - set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -configuration "Debug" -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | xcpretty |
45 |
| - bash <(curl -s https://codecov.io/bash) |
46 |
| - env: |
47 |
| - destination: ${{ matrix.destination }} |
48 |
| - - name: Upload Code Coverage |
49 |
| - run: | |
50 |
| - bash <(curl -s https://codecov.io/bash) |
51 |
| - env: |
52 |
| - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
53 |
| - # iOS-legacy: |
54 |
| - # name: Test iOS |
55 |
| - # runs-on: macOS-latest |
56 |
| - # env: |
57 |
| - # DEVELOPER_DIR: /Applications/Xcode_10.3.1.app/Contents/Developer |
58 |
| - # strategy: |
59 |
| - # matrix: |
60 |
| - # destination: [ |
61 |
| - # 'platform=iOS Simulator,OS=10.3.1,name=iPhone 7' |
62 |
| - # ] |
63 |
| - # steps: |
64 |
| - # - name: Checkout |
65 |
| - # uses: actions/checkout@master |
66 |
| - # - name: iOS - ${{ matrix.destination }} |
67 |
| - # run: | |
68 |
| - # xcversion simulators --install='iOS 10.3.1' |
69 |
| - # pod install |
70 |
| - # set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty |
71 |
| - # bash <(curl -s https://codecov.io/bash) |
72 |
| - # env: |
73 |
| - # destination: ${{ matrix.destination }} |
74 |
| - # - name: Upload Code Coverage |
75 |
| - # run: | |
76 |
| - # bash <(curl -s https://codecov.io/bash) |
77 |
| - # env: |
78 |
| - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
79 |
| - tvOS: |
80 |
| - name: Test tvOS |
81 |
| - runs-on: macOS-latest |
82 |
| - env: |
83 |
| - DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer |
84 |
| - strategy: |
85 |
| - matrix: |
86 |
| - destination: [ |
87 |
| - 'platform=tvOS Simulator,OS=14.3,name=Apple TV 4K' |
88 |
| - ] |
89 | 51 |
|
90 |
| - steps: |
91 |
| - - name: Checkout |
92 |
| - uses: actions/checkout@master |
93 |
| - - name: tvOS - ${{ matrix.destination }} |
94 |
| - run: | |
95 |
| - pod install |
96 |
| - set -o pipefail && xcodebuild clean build -workspace Hero.xcworkspace -scheme "Hero (tvOS)" -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | xcpretty |
97 |
| - env: |
98 |
| - destination: ${{ matrix.destination }} |
| 52 | + - name: Test - ${{ matrix.run-config.platform }} |
| 53 | + |
| 54 | + with: |
| 55 | + platform: ${{ matrix.run-config.platform }} |
| 56 | + action: ${{ matrix.run-config.action }} |
| 57 | + code-coverage: ${{ matrix.run-config.code-coverage }} |
| 58 | + configuration: Debug |
| 59 | + scheme: ${{ matrix.run-config.scheme }} |
| 60 | + workspace: Hero.xcworkspace |
| 61 | + |
| 62 | + - name: Upload Code Coverage |
| 63 | + uses: codecov/codecov-action@v3 |
| 64 | + if: ${{ matrix.run-config.code-coverage }} |
| 65 | + with: |
| 66 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments