|
5 | 5 | branches: [main, develop] |
6 | 6 | pull_request: |
7 | 7 | branches: [main, develop] |
| 8 | + workflow_dispatch: |
8 | 9 |
|
9 | | -env: |
10 | | - XCODE_VERSION: "16.4" |
| 10 | +concurrency: |
| 11 | + group: ci-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
11 | 13 |
|
12 | 14 | jobs: |
13 | | - test: |
14 | | - name: Tests |
| 15 | + xcodebuild-latest: |
| 16 | + name: xcodebuild (16.4) |
15 | 17 | runs-on: macos-15 |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + command: [test, ""] |
| 21 | + platform: [IOS, MACOS, TVOS, WATCHOS, VISIONOS] |
| 22 | + xcode: ["16.4"] |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
16 | 25 |
|
17 | | - strategy: |
18 | | - matrix: |
19 | | - include: |
20 | | - - name: "macOS" |
21 | | - destination: "platform=macOS" |
22 | | - - name: "iOS" |
23 | | - destination: "platform=iOS Simulator,name=iPhone 15,OS=latest" |
24 | | - - name: "tvOS" |
25 | | - destination: "platform=tvOS Simulator,name=Apple TV,OS=latest" |
26 | | - - name: "watchOS" |
27 | | - destination: "platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=latest" |
| 26 | + - name: Select Xcode ${{ matrix.xcode }} |
| 27 | + run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app |
28 | 28 |
|
29 | | - steps: |
30 | | - - name: Checkout code |
31 | | - uses: actions/checkout@v4 |
| 29 | + - name: Update xcbeautify |
| 30 | + run: brew update && brew upgrade xcbeautify |
32 | 31 |
|
33 | | - - name: Setup Swift |
34 | | - uses: swift-actions/setup-swift@v2.3.0 |
35 | | - with: |
36 | | - swift-version: "6.0.0" |
| 32 | + - name: List available devices |
| 33 | + run: xcrun simctl list devices available |
37 | 34 |
|
38 | | - - name: Cache Swift packages |
39 | | - uses: actions/cache@v4 |
| 35 | + - name: Cache derived data |
| 36 | + uses: actions/cache@v3 |
40 | 37 | with: |
41 | 38 | path: | |
42 | | - ~/Library/Caches/org.swift.swiftpm |
43 | | - .build |
44 | | - key: ${{ runner.os }}-swift-${{ hashFiles('**/Package.resolved') }} |
| 39 | + ~/.derivedData |
| 40 | + key: | |
| 41 | + deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }} |
45 | 42 | restore-keys: | |
46 | | - ${{ runner.os }}-swift- |
| 43 | + deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}- |
47 | 44 |
|
48 | | - - name: Build and test with xcodebuild |
| 45 | + - name: Set IgnoreFileSystemDeviceInodeChanges flag |
| 46 | + run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES |
| 47 | + |
| 48 | + - name: Update mtime for incremental builds |
| 49 | + uses: chetan/git-restore-mtime-action@v2 |
| 50 | + |
| 51 | + - name: Debug |
49 | 52 | run: | |
50 | | - case ${{ matrix.name }} in |
51 | | - "macOS") |
52 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' build |
53 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' test -only-testing:NetworkTests |
| 53 | + case ${{ matrix.platform }} in |
| 54 | + "MACOS") |
| 55 | + xcodebuild -workspace Network.xcworkspace -scheme Network -destination 'platform=macOS' ${{ matrix.command }} |
| 56 | + ;; |
| 57 | + "IOS") |
| 58 | + xcodebuild -workspace Network.xcworkspace -scheme Network -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.5' ${{ matrix.command }} |
54 | 59 | ;; |
55 | | - "iOS") |
56 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' build |
57 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' test -only-testing:NetworkTests |
| 60 | + "TVOS") |
| 61 | + xcodebuild -workspace Network.xcworkspace -scheme Network -destination 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=18.5' ${{ matrix.command }} |
58 | 62 | ;; |
59 | | - "tvOS") |
60 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' build |
61 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' test -only-testing:NetworkTests |
| 63 | + "WATCHOS") |
| 64 | + xcodebuild -workspace Network.xcworkspace -scheme Network -destination 'platform=watchOS Simulator,name=Apple Watch Series 10 (42mm),OS=11.5' ${{ matrix.command }} |
62 | 65 | ;; |
63 | | - "watchOS") |
64 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' build |
65 | | - xcodebuild -workspace Network.xcworkspace -scheme Network -destination '${{ matrix.destination }}' test -only-testing:NetworkTests |
| 66 | + "VISIONOS") |
| 67 | + xcodebuild -workspace Network.xcworkspace -scheme Network -destination 'platform=visionOS Simulator,name=Apple Vision Pro,OS=2.5' ${{ matrix.command }} |
66 | 68 | ;; |
67 | 69 | esac |
0 commit comments