|
1 | 1 | name: CI |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | | - branches: |
6 | | - - main |
| 4 | + branches: [main] |
7 | 5 | pull_request: |
8 | | - branches: |
9 | | - - '*' |
| 6 | + branches: [main] |
10 | 7 | workflow_dispatch: |
11 | 8 |
|
12 | 9 | concurrency: |
13 | 10 | group: ci-${{ github.ref }} |
14 | 11 | cancel-in-progress: true |
15 | 12 |
|
16 | 13 | jobs: |
17 | | - macos: |
18 | | - name: macOS (Xcode ${{ matrix.xcode }}) |
19 | | - runs-on: macos-${{ matrix.os }} |
| 14 | + macos-swift61: |
| 15 | + name: macOS (Swift 6.1) |
| 16 | + runs-on: macos-26 |
20 | 17 | strategy: |
21 | | - fail-fast: false |
22 | 18 | matrix: |
23 | | - include: |
24 | | - - os: '26' |
25 | | - xcode: '26.0' |
26 | | - swift: '6.2' |
| 19 | + xcode: ['26.0'] |
| 20 | + config: ['debug', 'release'] |
27 | 21 | steps: |
28 | 22 | - uses: actions/checkout@v5 |
29 | | - |
30 | 23 | - name: Select Xcode ${{ matrix.xcode }} |
31 | 24 | run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app |
32 | | - |
33 | | - - name: Print environment |
34 | | - run: | |
35 | | - xcodebuild -version |
36 | | - swift --version |
37 | | - echo "macOS $(sw_vers -productVersion)" |
38 | | -
|
| 25 | + - name: Print Swift version |
| 26 | + run: swift --version |
39 | 27 | - name: Cache Swift packages |
40 | 28 | uses: actions/cache@v4 |
41 | 29 | with: |
42 | 30 | path: .build |
43 | | - key: ${{ runner.os }}-xcode-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }} |
44 | | - restore-keys: | |
45 | | - ${{ runner.os }}-xcode-${{ matrix.xcode }}-spm- |
46 | | - ${{ runner.os }}-spm- |
47 | | -
|
48 | | - - name: Build and test |
49 | | - run: swift test --filter StructuredQueriesPostgresTests |
50 | | - timeout-minutes: 15 |
| 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 }} |
51 | 37 |
|
52 | | - linux: |
53 | | - name: Linux (Swift ${{ matrix.swift }}) |
54 | | - runs-on: ubuntu-latest |
55 | | - container: swift:${{ matrix.swift }} |
| 38 | + macos-swift62: |
| 39 | + name: macOS (Swift 6.2) |
| 40 | + runs-on: macos-26 |
56 | 41 | strategy: |
57 | | - fail-fast: false |
58 | 42 | matrix: |
59 | | - swift: |
60 | | - - '6.1' |
61 | | - - '6.2' |
| 43 | + xcode: ['26.0'] |
| 44 | + config: ['debug', 'release'] |
62 | 45 | steps: |
63 | 46 | - uses: actions/checkout@v5 |
64 | | - |
65 | | - - name: Print environment |
66 | | - run: | |
67 | | - swift --version |
68 | | - uname -a |
69 | | -
|
| 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 |
70 | 51 | - name: Cache Swift packages |
71 | 52 | uses: actions/cache@v4 |
72 | 53 | with: |
73 | 54 | path: .build |
74 | | - key: linux-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.swift') }} |
75 | | - restore-keys: | |
76 | | - linux-swift-${{ matrix.swift }}-spm- |
77 | | - linux-spm- |
| 55 | + key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }} |
| 56 | + 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 }} |
78 | 61 |
|
79 | | - - name: Build and test |
80 | | - run: swift test --filter StructuredQueriesPostgresTests |
81 | | - timeout-minutes: 15 |
| 62 | + linux-swift62: |
| 63 | + name: Ubuntu (Swift 6.2) |
| 64 | + runs-on: ubuntu-latest |
| 65 | + container: swift:6.2 |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v5 |
| 68 | + - name: Build |
| 69 | + run: swift build |
| 70 | + - name: Run tests |
| 71 | + run: swift test |
82 | 72 |
|
83 | | - documentation: |
84 | | - name: Documentation |
85 | | - runs-on: macos-26 |
| 73 | + windows: |
| 74 | + name: Windows (Swift 6.2) |
| 75 | + runs-on: windows-latest |
86 | 76 | steps: |
87 | 77 | - uses: actions/checkout@v5 |
| 78 | + - uses: SwiftyLab/setup-swift@latest |
| 79 | + with: |
| 80 | + swift-version: "6.2" |
| 81 | + - name: Build |
| 82 | + run: swift build |
| 83 | + - name: Run tests |
| 84 | + run: swift test |
88 | 85 |
|
| 86 | + readme-validation: |
| 87 | + name: README Code Examples |
| 88 | + runs-on: macos-26 |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v5 |
89 | 91 | - name: Select Xcode |
90 | | - run: sudo xcode-select -s /Applications/Xcode_26.0.1.app |
91 | | - |
92 | | - - name: Build documentation |
93 | | - run: | |
94 | | - swift package \ |
95 | | - --allow-writing-to-directory ./docs \ |
96 | | - generate-documentation \ |
97 | | - --target StructuredQueriesCore \ |
98 | | - --output-path ./docs \ |
99 | | - --transform-for-static-hosting \ |
100 | | - --hosting-base-path swift-structured-queries-postgres |
101 | | - continue-on-error: true # DocC may not be fully configured yet |
| 92 | + run: sudo xcode-select -s /Applications/Xcode_26.0.app |
| 93 | + - name: Run README verification tests |
| 94 | + run: swift test --filter READMEExamplesTests |
0 commit comments