|
1 | 1 | name: CI |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | | - branches: [main] |
| 5 | + branches: |
| 6 | + - main |
5 | 7 | pull_request: |
6 | | - branches: [main] |
| 8 | + branches: |
| 9 | + - main |
7 | 10 | workflow_dispatch: |
8 | 11 |
|
9 | 12 | concurrency: |
10 | 13 | group: ci-${{ github.ref }} |
11 | 14 | cancel-in-progress: true |
12 | 15 |
|
13 | 16 | jobs: |
14 | | - macos-swift59: |
15 | | - name: macOS (Swift 5.9) |
| 17 | + # Primary development workflow: Latest Swift on macOS with debug build |
| 18 | + macos-latest: |
| 19 | + name: macOS (Swift 6.2, debug) |
16 | 20 | runs-on: macos-26 |
17 | | - strategy: |
18 | | - matrix: |
19 | | - xcode: ['26.0'] |
20 | | - config: ['debug', 'release'] |
21 | 21 | steps: |
22 | 22 | - uses: actions/checkout@v5 |
23 | | - - name: Select Xcode ${{ matrix.xcode }} |
24 | | - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app |
| 23 | + |
| 24 | + - name: Select Xcode 26.0 |
| 25 | + run: sudo xcode-select -s /Applications/Xcode_26.0.app |
| 26 | + |
25 | 27 | - name: Print Swift version |
26 | 28 | run: swift --version |
| 29 | + |
27 | 30 | - name: Cache Swift packages |
28 | 31 | uses: actions/cache@v4 |
29 | 32 | with: |
30 | 33 | path: .build |
31 | | - key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }} |
32 | | - restore-keys: ${{ runner.os }}-spm- |
33 | | - - name: Build |
34 | | - run: swift build -c ${{ matrix.config }} |
35 | | - - name: Run tests |
36 | | - run: swift test -c ${{ matrix.config }} |
| 34 | + key: ${{ runner.os }}-spm-${{ hashFiles('Package.swift') }} |
| 35 | + restore-keys: | |
| 36 | + ${{ runner.os }}-spm- |
37 | 37 |
|
38 | | - macos-swift62: |
39 | | - name: macOS (Swift 6.2) |
40 | | - runs-on: macos-26 |
41 | | - strategy: |
42 | | - matrix: |
43 | | - xcode: ['26.0'] |
44 | | - config: ['debug', 'release'] |
| 38 | + # Note: swift test builds automatically, no separate build step needed |
| 39 | + - name: Test |
| 40 | + run: swift test -c debug |
| 41 | + |
| 42 | + - name: Validate Package.swift |
| 43 | + run: swift package dump-package |
| 44 | + |
| 45 | + - name: Run README verification tests |
| 46 | + run: swift test --filter ReadmeVerificationTests |
| 47 | + |
| 48 | + - name: Check for API breaking changes |
| 49 | + run: | |
| 50 | + swift package diagnose-api-breaking-changes \ |
| 51 | + --breakage-allowlist-path .swift-api-breakage-allowlist || true |
| 52 | + continue-on-error: true |
| 53 | + |
| 54 | + # Production validation: Latest Swift on Linux with release build |
| 55 | + linux-latest: |
| 56 | + name: Ubuntu (Swift 6.2, release) |
| 57 | + runs-on: ubuntu-latest |
| 58 | + container: swift:6.2 |
45 | 59 | steps: |
46 | 60 | - uses: actions/checkout@v5 |
47 | | - - name: Select Xcode ${{ matrix.xcode }} |
48 | | - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app |
49 | | - - name: Print Swift version |
50 | | - run: swift --version |
| 61 | + |
51 | 62 | - name: Cache Swift packages |
52 | 63 | uses: actions/cache@v4 |
53 | 64 | with: |
54 | 65 | path: .build |
55 | | - key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }} |
| 66 | + key: ${{ runner.os }}-spm-${{ hashFiles('Package.swift') }} |
56 | 67 | restore-keys: ${{ runner.os }}-spm- |
57 | | - - name: Build |
58 | | - run: swift build -c ${{ matrix.config }} |
59 | | - - name: Run tests |
60 | | - run: swift test -c ${{ matrix.config }} |
61 | 68 |
|
62 | | - linux-swift62: |
63 | | - name: Ubuntu (Swift 6.2) |
| 69 | + # Note: swift test builds automatically in release mode |
| 70 | + - name: Test (release) |
| 71 | + run: swift test -c release |
| 72 | + |
| 73 | + # Compatibility check: Minimum supported Swift version (6.0) |
| 74 | + # Note: Swift Testing framework requires Swift 6.0+ |
| 75 | + linux-compat: |
| 76 | + name: Ubuntu (Swift 6.0, compatibility) |
64 | 77 | runs-on: ubuntu-latest |
65 | | - container: swift:6.2 |
| 78 | + container: swift:6.0 |
66 | 79 | steps: |
67 | 80 | - uses: actions/checkout@v5 |
| 81 | + |
68 | 82 | - name: Cache Swift packages |
69 | 83 | uses: actions/cache@v4 |
70 | 84 | with: |
71 | 85 | path: .build |
72 | | - key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }} |
73 | | - restore-keys: ${{ runner.os }}-spm- |
74 | | - - name: Build |
75 | | - run: swift build |
76 | | - - name: Run tests |
77 | | - run: swift test |
| 86 | + key: ${{ runner.os }}-swift60-spm-${{ hashFiles('Package.swift') }} |
| 87 | + restore-keys: ${{ runner.os }}-swift60-spm- |
78 | 88 |
|
79 | | - readme-validation: |
80 | | - name: README Code Examples |
81 | | - runs-on: macos-26 |
82 | | - steps: |
83 | | - - uses: actions/checkout@v5 |
84 | | - - name: Select Xcode |
85 | | - run: sudo xcode-select -s /Applications/Xcode_26.0.app |
86 | | - - name: Run README verification tests |
87 | | - run: swift test --filter ReadmeVerificationTests |
| 89 | + # Note: swift test builds automatically |
| 90 | + - name: Test (Swift 6.0) |
| 91 | + run: swift test -c release |
0 commit comments