|
1 | | -name: Build and Test |
| 1 | +# CI Matrix Policy |
| 2 | +# |
| 3 | +# Category A (tools-version 6.2 + macOS 26 min): macos-26 + Swift 6.2 |
| 4 | +# Category B (tools-version 6.2 + older macOS): macos-15 + 6.2, macos-26 + 6.2 |
| 5 | +# Category C (tools-version 6.0): macos-15 + 6.0, macos-15 + 6.2, macos-26 + 6.2 |
| 6 | +# Linux (if viable): ubuntu + Swift 6.0, ubuntu + Swift 6.2 |
| 7 | +# |
| 8 | +# When Swift 6.3 ships: bump 6.0→6.1 and 6.2→6.3 in Category C |
| 9 | +# When bumping tools-version to 6.2: drop 6.0/6.1, move to Category A or B |
| 10 | + |
| 11 | +name: CI |
2 | 12 |
|
3 | 13 | on: |
4 | 14 | push: |
|
7 | 17 | branches: [main] |
8 | 18 |
|
9 | 19 | concurrency: |
10 | | - group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
11 | 21 | cancel-in-progress: true |
12 | 22 |
|
13 | 23 | jobs: |
14 | | - build-test: |
| 24 | + tests: |
15 | 25 | name: Build and Test |
16 | | - runs-on: macos-26 |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + include: |
| 30 | + - os: macos-26 |
| 31 | + swift: "6.2" |
| 32 | + runs-on: ${{ matrix.os }} |
17 | 33 | steps: |
18 | | - - name: Checkout |
19 | | - uses: actions/checkout@v4 |
20 | | - |
21 | | - - name: Setup Swift |
22 | | - uses: swift-actions/setup-swift@v2 |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + - uses: SwiftyLab/setup-swift@latest |
23 | 36 | with: |
24 | | - swift-version: '6.2' |
25 | | - |
| 37 | + swift-version: ${{ matrix.swift }} |
26 | 38 | - name: Build |
27 | 39 | run: swift build -v |
28 | | - |
29 | | - - name: Run Tests |
| 40 | + - name: Test |
30 | 41 | run: swift test -v |
31 | | - |
32 | | - swiftlint: |
33 | | - name: SwiftLint |
| 42 | + test-linux: |
| 43 | + name: Test on Linux |
34 | 44 | runs-on: ubuntu-latest |
| 45 | + container: |
| 46 | + image: swift:6.2 |
35 | 47 | steps: |
36 | | - - name: Checkout |
37 | | - uses: actions/checkout@v4 |
38 | | - |
39 | | - - name: SwiftLint |
40 | | - uses: norio-nomura/action-swiftlint@3.2.1 |
41 | | - |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + - name: Build |
| 50 | + run: swift build -v |
| 51 | + - name: Test |
| 52 | + run: swift test -v |
| 53 | + lint: |
| 54 | + name: Run Swiftlint |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + - uses: norio-nomura/action-swiftlint@3.2.1 |
42 | 59 | swift-format: |
43 | | - name: swift-format |
| 60 | + name: Run swift-format |
44 | 61 | runs-on: ubuntu-latest |
45 | 62 | container: |
46 | | - image: swift:6.2 |
| 63 | + image: swift:latest |
47 | 64 | steps: |
48 | | - - name: Checkout |
49 | | - uses: actions/checkout@v4 |
50 | | - |
51 | | - - name: Install swift-format |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + - name: Download .swift-format config |
52 | 67 | run: | |
53 | | - git clone --branch 600.0.0 --depth 1 https://github.com/swiftlang/swift-format.git /tmp/swift-format |
54 | | - cd /tmp/swift-format |
55 | | - swift build -c release |
56 | | - cp /tmp/swift-format/.build/release/swift-format /usr/local/bin/ |
57 | | -
|
58 | | - - name: Run swift-format |
59 | | - run: swift-format lint -r . |
| 68 | + apt-get update && apt-get install -y wget |
| 69 | + wget -O .swift-format https://gist.githubusercontent.com/RISCfuture/e0c21afb7bd80a88d128a42bf40d2ecd/raw/.swift-format |
| 70 | + - name: Run swift-format lint |
| 71 | + run: swift format lint -r . |
0 commit comments