Skip to content

Commit 90dedcc

Browse files
committed
Update github action ci
1 parent 5eb235d commit 90dedcc

File tree

2 files changed

+44
-42
lines changed

2 files changed

+44
-42
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,65 @@ on:
55
branches: [main, develop]
66
pull_request:
77
branches: [main, develop]
8+
workflow_dispatch:
89

9-
env:
10-
XCODE_VERSION: "16.4"
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
1113

1214
jobs:
13-
test:
14-
name: Tests
15+
xcodebuild-latest:
16+
name: xcodebuild (16.4)
1517
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
1625

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
2828

29-
steps:
30-
- name: Checkout code
31-
uses: actions/checkout@v4
29+
- name: Update xcbeautify
30+
run: brew update && brew upgrade xcbeautify
3231

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
3734

38-
- name: Cache Swift packages
39-
uses: actions/cache@v4
35+
- name: Cache derived data
36+
uses: actions/cache@v3
4037
with:
4138
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') }}
4542
restore-keys: |
46-
${{ runner.os }}-swift-
43+
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-
4744
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
4952
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 }}
5459
;;
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 }}
5862
;;
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 }}
6265
;;
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 }}
6668
;;
6769
esac
Binary file not shown.

0 commit comments

Comments
 (0)