|
9 | 9 |
|
10 | 10 | permissions:
|
11 | 11 | contents: read
|
| 12 | + actions: write |
12 | 13 |
|
13 | 14 | concurrency:
|
14 | 15 | group: test-${{ github.ref }}
|
|
30 | 31 | xcode: '15.4'
|
31 | 32 | steps:
|
32 | 33 | - name: Checkout
|
33 |
| - uses: actions/checkout@v4 |
| 34 | + uses: actions/checkout@v5 |
34 | 35 | - name: Select Xcode ${{ matrix.xcode }}
|
35 | 36 | uses: maxim-lobanov/setup-xcode@v1
|
36 | 37 | with:
|
|
53 | 54 | xcode: '16.3'
|
54 | 55 | steps:
|
55 | 56 | - name: Checkout
|
56 |
| - uses: actions/checkout@v4 |
| 57 | + uses: actions/checkout@v5 |
57 | 58 |
|
58 | 59 | - name: Select Xcode ${{ matrix.xcode }}
|
59 | 60 | uses: maxim-lobanov/setup-xcode@v1
|
@@ -123,3 +124,93 @@ jobs:
|
123 | 124 | name: QsSwift-${{ matrix.os }}-swift-${{ matrix.swift }}
|
124 | 125 | env:
|
125 | 126 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
| 127 | + |
| 128 | + objc-tests: |
| 129 | + name: Objective-C E2E tests (Xcode) |
| 130 | + runs-on: ${{ matrix.os }} |
| 131 | + needs: tests |
| 132 | + strategy: |
| 133 | + fail-fast: false |
| 134 | + matrix: |
| 135 | + include: |
| 136 | + - os: macos-15 |
| 137 | + xcode: '16.3' |
| 138 | + |
| 139 | + steps: |
| 140 | + - name: Checkout |
| 141 | + uses: actions/checkout@v5 |
| 142 | + |
| 143 | + - name: Select Xcode ${{ matrix.xcode }} |
| 144 | + uses: maxim-lobanov/setup-xcode@v1 |
| 145 | + with: |
| 146 | + xcode-version: ${{ matrix.xcode }} |
| 147 | + |
| 148 | + - name: Show Xcode & Swift versions |
| 149 | + run: | |
| 150 | + xcodebuild -version |
| 151 | + swift --version |
| 152 | +
|
| 153 | + - name: Resolve SPM dependencies (ObjC test project) |
| 154 | + run: | |
| 155 | + set -euxo pipefail |
| 156 | + xcodebuild \ |
| 157 | + -project ObjCE2ETests/ObjCE2ETests.xcodeproj \ |
| 158 | + -scheme ObjCE2ETests \ |
| 159 | + -resolvePackageDependencies |
| 160 | +
|
| 161 | + - name: Run Objective-C tests (macOS) |
| 162 | + env: |
| 163 | + NSUnbufferedIO: "YES" |
| 164 | + run: | |
| 165 | + set -euxo pipefail |
| 166 | + xcodebuild \ |
| 167 | + -project ObjCE2ETests/ObjCE2ETests.xcodeproj \ |
| 168 | + -scheme ObjCE2ETests \ |
| 169 | + -configuration Debug \ |
| 170 | + -destination "platform=macOS" \ |
| 171 | + CODE_SIGNING_ALLOWED=NO \ |
| 172 | + -resultBundlePath ObjC-Tests.xcresult \ |
| 173 | + test |
| 174 | +
|
| 175 | + - name: Upload ObjC test result bundle |
| 176 | + if: ${{ always() }} |
| 177 | + uses: actions/upload-artifact@v4 |
| 178 | + with: |
| 179 | + name: ObjC-Tests-xcode-${{ matrix.xcode }} |
| 180 | + path: ObjC-Tests.xcresult |
| 181 | + |
| 182 | + - name: Collect macOS crash logs (ObjC job) |
| 183 | + if: ${{ failure() }} |
| 184 | + run: | |
| 185 | + set -euxo pipefail |
| 186 | + mkdir -p crashlogs-objc |
| 187 | + USER_DR="$HOME/Library/Logs/DiagnosticReports" |
| 188 | + SYS_DR="/Library/Logs/DiagnosticReports" |
| 189 | + for dir in "$USER_DR" "$SYS_DR"; do |
| 190 | + if [ -d "$dir" ]; then |
| 191 | + echo "=== Listing $dir ===" |
| 192 | + ls -lah "$dir" || true |
| 193 | + fi |
| 194 | + done |
| 195 | + for dir in "$USER_DR" "$SYS_DR"; do |
| 196 | + if [ -d "$dir" ]; then |
| 197 | + CP="cp" |
| 198 | + if [ "$dir" = "$SYS_DR" ]; then CP="sudo cp"; fi |
| 199 | + find "$dir" -type f \ |
| 200 | + \( -name '*.crash' -o -name '*.ips' -o -name '*.hang' -o -name '*.spin' \) \ |
| 201 | + -mmin -60 -print -exec $CP {} crashlogs-objc/ \; || true |
| 202 | + fi |
| 203 | + done |
| 204 | + /usr/bin/log show --style syslog --last 30m \ |
| 205 | + --predicate 'eventMessage CONTAINS[c] "xctest" OR process CONTAINS[c] "xctest" OR process CONTAINS[c] "swift"' \ |
| 206 | + > crashlogs-objc/unified-log.txt 2>/dev/null || true |
| 207 | + echo "Collected files:" |
| 208 | + ls -lah crashlogs-objc || true |
| 209 | +
|
| 210 | + - name: Upload macOS crash logs (ObjC job, if any) |
| 211 | + if: ${{ failure() }} |
| 212 | + uses: actions/upload-artifact@v4 |
| 213 | + with: |
| 214 | + name: macOS-crashlogs-objc-xcode-${{ matrix.xcode }} |
| 215 | + path: crashlogs-objc |
| 216 | + if-no-files-found: ignore |
0 commit comments