|
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
8 | 8 |
|
| 9 | +env: |
| 10 | + SCHEME: "swift-user-defaults" |
| 11 | + XCODEBUILD: set -o pipefail && env NSUnbufferedIO=YES xcodebuild |
| 12 | + |
9 | 13 | jobs: |
10 | | - build: |
11 | | - name: Checks (Xcode ${{ matrix.xcode_version }}) |
12 | | - runs-on: macos-11 |
| 14 | + test-macos: |
| 15 | + name: Test (macOS, Xcode ${{ matrix.xcode }}) |
| 16 | + runs-on: ${{ matrix.macos }} |
13 | 17 | env: |
14 | | - SCHEME: "swift-user-defaults" |
15 | | - DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer' |
| 18 | + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + xcode: [ 14.3.1, 15.2 ] |
| 22 | + include: |
| 23 | + - xcode: 14.3.1 |
| 24 | + macos: macos-14 |
| 25 | + - xcode: 15.2 |
| 26 | + macos: macos-14 |
| 27 | + steps: |
| 28 | + - name: Checkout Repo |
| 29 | + uses: actions/checkout@v4 |
| 30 | + - name: Test |
| 31 | + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "platform=macOS" clean test | xcbeautify |
16 | 32 |
|
| 33 | + test-ios: |
| 34 | + name: Test (iOS, Xcode ${{ matrix.xcode }}) |
| 35 | + runs-on: ${{ matrix.macos }} |
| 36 | + env: |
| 37 | + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' |
17 | 38 | strategy: |
18 | 39 | matrix: |
19 | | - xcode_version: ['12.5', '13.1'] |
| 40 | + xcode: [ 14.3.1, 15.2 ] |
20 | 41 | include: |
21 | | - - xcode_version: '12.5' |
22 | | - destination_ios: 'OS=14.5,name=iPhone 12' |
23 | | - destination_macos: 'platform=macOS' |
24 | | - destination_watchos: 'OS=7.4,name=Apple Watch Series 6 - 44mm' |
25 | | - destination_tvos: 'OS=14.5,name=Apple TV' |
26 | | - - xcode_version: '13.1' |
27 | | - destination_ios: 'OS=15.0,name=iPhone 13' |
28 | | - destination_macos: 'platform=macOS' |
29 | | - destination_watchos: 'OS=8.0,name=Apple Watch Series 7 - 45mm' |
30 | | - destination_tvos: 'OS=15.0,name=Apple TV' |
| 42 | + - xcode: 14.3.1 |
| 43 | + macos: macos-14 |
| 44 | + destination: "platform=iOS Simulator,name=iPhone 14,OS=16.4" |
| 45 | + - xcode: 15.2 |
| 46 | + macos: macos-14 |
| 47 | + destination: "platform=iOS Simulator,name=iPhone 14,OS=17.2" |
| 48 | + steps: |
| 49 | + - name: Checkout Repo |
| 50 | + uses: actions/checkout@v4 |
| 51 | + - name: Test |
| 52 | + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify |
31 | 53 |
|
| 54 | + test-tvos: |
| 55 | + name: Test (tvOS, Xcode ${{ matrix.xcode }}) |
| 56 | + runs-on: ${{ matrix.macos }} |
| 57 | + strategy: |
| 58 | + matrix: |
| 59 | + xcode: [ 14.3.1, 15.2 ] |
| 60 | + include: |
| 61 | + - xcode: 14.3.1 |
| 62 | + macos: macos-14 |
| 63 | + destination: "platform=tvOS Simulator,name=Apple TV,OS=16.4" |
| 64 | + - xcode: 15.2 |
| 65 | + macos: macos-14 |
| 66 | + destination: "platform=tvOS Simulator,name=Apple TV,OS=17.2" |
| 67 | + env: |
| 68 | + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' |
32 | 69 | steps: |
33 | | - - uses: actions/checkout@v2 |
| 70 | + - name: Checkout Repo |
| 71 | + uses: actions/checkout@v4 |
| 72 | + - name: Test |
| 73 | + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify |
34 | 74 |
|
35 | | - # Setup Ruby and Bundler |
| 75 | + test-watchos: |
| 76 | + name: Test (watchOS, Xcode ${{ matrix.xcode }}) |
| 77 | + runs-on: ${{ matrix.macos }} |
| 78 | + strategy: |
| 79 | + matrix: |
| 80 | + xcode: [ 14.3.1, 15.2 ] |
| 81 | + include: |
| 82 | + - xcode: 14.3.1 |
| 83 | + macos: macos-14 |
| 84 | + destination: "platform=watchOS Simulator,name=Apple Watch Series 8 (41mm),OS=9.4" |
| 85 | + - xcode: 15.2 |
| 86 | + macos: macos-14 |
| 87 | + destination: "platform=watchOS Simulator,name=Apple Watch Series 9 (41mm),OS=10.2" |
| 88 | + env: |
| 89 | + DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' |
| 90 | + steps: |
| 91 | + - name: Checkout Repo |
| 92 | + uses: actions/checkout@v4 |
| 93 | + - name: Test |
| 94 | + run: ${{ env.XCODEBUILD }} -scheme "${{ env.SCHEME }}" -destination "${{ matrix.destination }}" clean test | xcbeautify |
| 95 | + |
| 96 | + example: |
| 97 | + name: Example Project |
| 98 | + runs-on: macos-14 |
| 99 | + env: |
| 100 | + DEVELOPER_DIR: '/Applications/Xcode_15.2.app/Contents/Developer' |
| 101 | + steps: |
| 102 | + - name: Checkout Repo |
| 103 | + uses: actions/checkout@v4 |
| 104 | + - name: UI Test |
| 105 | + run: ${{ env.XCODEBUILD }} -workspace "Example/Example.xcworkspace" -scheme "Example" -destination "platform=iOS Simulator,name=iPhone 14,OS=17.2" clean test | xcbeautify |
| 106 | + |
| 107 | + cocoapods: |
| 108 | + name: CocoaPods |
| 109 | + runs-on: macos-14 |
| 110 | + steps: |
| 111 | + - name: Checkout Repo |
| 112 | + uses: actions/checkout@v4 |
36 | 113 | - name: Setup Ruby |
37 | 114 | uses: ruby/setup-ruby@v1 |
38 | 115 | with: |
39 | 116 | bundler-cache: true |
40 | | - |
41 | | - # Build library & Run Unit-Tests (MacOS) |
42 | | - - name: Build & Unit-Test Library (MacOS) |
43 | | - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_macos }}" clean test | bundle exec xcpretty |
44 | | - |
45 | | - # Build library & Run Unit-Tests (iOS) |
46 | | - - name: Build & Unit-Test Library (iOS) |
47 | | - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_ios }}" clean test | bundle exec xcpretty |
48 | | - |
49 | | - # Build library & Run Unit-Tests (watchOS) |
50 | | - - name: Build & Unit-Test Library (watchOS) |
51 | | - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_watchos }}" clean test | bundle exec xcpretty |
52 | | - |
53 | | - # Build library & Run Unit-Tests (tvOS) |
54 | | - - name: Build & Unit-Test Library (tvOS) |
55 | | - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme $SCHEME -destination "${{ matrix.destination_tvos }}" clean test | bundle exec xcpretty |
56 | | - |
57 | | - # Build Example Project & Run UI-Tests (iOS) |
58 | | - - name: Build & UI-Test Example Project (iOS) |
59 | | - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Example/Example.xcworkspace" -scheme "Example" -destination "${{ matrix.destination_ios }}" clean test | bundle exec xcpretty |
60 | | - |
61 | | - # Verify CocoaPods |
62 | | - - name: Verify CocoaPods |
63 | | - run: bundle exec pod lib lint |
| 117 | + - name: Lint |
| 118 | + run: make lint |
0 commit comments