|
1 | | -name: "swiftkube-client-ci" |
| 1 | +name: "CI" |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [ "main" ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ "*" ] |
8 | 8 |
|
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
9 | 13 | jobs: |
10 | 14 |
|
11 | | - swiftformat-lint: |
12 | | - runs-on: ubuntu-latest |
13 | | - steps: |
14 | | - - name: Checkout |
15 | | - uses: actions/checkout@v2 |
16 | | - - name: Install SwiftFormat |
17 | | - uses: Cyberbeni/install-swift-tool@v2 |
18 | | - with: |
19 | | - url: https://github.com/nicklockwood/SwiftFormat |
20 | | - - name: Lint Sources |
21 | | - run: swiftformat --lint Sources |
22 | | - iOS: |
23 | | - name: Test iOS |
24 | | - runs-on: macOS-latest |
25 | | - strategy: |
26 | | - matrix: |
27 | | - destination: |
28 | | - - "platform=iOS Simulator,OS=18.5,name=iPhone 16 Pro" |
29 | | - - "platform=iOS Simulator,OS=18.5,name=iPad Pro 13-inch (M4)" |
| 15 | + lint: |
| 16 | + runs-on: ubuntu-latest |
30 | 17 | steps: |
31 | | - - name: Checkout |
32 | | - uses: actions/checkout@v2 |
33 | | - - name: iOS - ${{ matrix.destination }} |
34 | | - run: set -o pipefail && xcodebuild -scheme SwiftkubeClient -destination "${{ matrix.destination }}" clean build | xcpretty |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v5 |
| 20 | + - name: Install SwiftFormat |
| 21 | + uses: Cyberbeni/install-swift-tool@v2 |
| 22 | + with: |
| 23 | + url: https://github.com/nicklockwood/SwiftFormat |
| 24 | + - name: Lint Sources |
| 25 | + run: swiftformat --lint Sources |
35 | 26 |
|
36 | | - build: |
37 | | - name: Swift ${{ matrix.swift }} on ${{ matrix.os }} |
38 | | - runs-on: ${{ matrix.os }} |
39 | | - continue-on-error: true |
| 27 | + linux: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + timeout-minutes: 15 |
40 | 30 | strategy: |
41 | 31 | matrix: |
42 | | - os: [ubuntu-22.04, macos-latest] |
43 | | - swift: ["5.9", "5.10", "6.0"] |
| 32 | + image: ["swift:5.10", "swift:6.0", "swift:6.1", "swiftlang/swift:nightly-6.2-noble"] |
| 33 | + container: |
| 34 | + image: ${{ matrix.image }} |
| 35 | + steps: |
| 36 | + - name: Checkout |
| 37 | + uses: actions/checkout@v5 |
| 38 | + - name: Build |
| 39 | + run: swift build |
| 40 | + |
| 41 | + macos: |
| 42 | + runs-on: macOS-latest |
| 43 | + timeout-minutes: 15 |
44 | 44 | steps: |
45 | 45 | - name: Checkout |
46 | | - uses: actions/checkout@v2 |
| 46 | + uses: actions/checkout@v5 |
47 | 47 | - name: SPM Cache |
48 | 48 | uses: actions/cache@v4 |
49 | 49 | with: |
50 | 50 | path: .build |
51 | | - key: ${{ matrix.os }}-${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }} |
| 51 | + key: macos-latests-${{ hashFiles('**/Package.resolved') }} |
52 | 52 | restore-keys: | |
53 | | - ${{ matrix.os }}-${{ matrix.swift }}- |
54 | | - # - name: Install runtime for macOS |
55 | | - # continue-on-error: true |
56 | | - # if: matrix.os == 'macos-latest' |
57 | | - # run: | |
58 | | - # brew install docker-machine docker |
59 | | - # brew services start docker-machine |
60 | | - # sudo docker --version |
61 | | - # sysctl hw.physicalcpu hw.logicalcpu |
62 | | - - name: Start minikube |
63 | | - if: matrix.os == 'ubuntu-22.04' |
64 | | - uses: medyagh/setup-minikube@latest |
65 | | - id: minikube |
66 | | - with: |
67 | | - minikube-version: 1.35.0 |
68 | | - - uses: swift-actions/setup-swift@v2 |
69 | | - with: |
70 | | - swift-version: ${{ matrix.swift }} |
71 | | - - name: Get swift version |
72 | | - run: swift --version |
| 53 | + macos-latests- |
73 | 54 | - name: Build |
74 | 55 | run: swift build |
75 | | - - name: Test Linux |
76 | | - if: matrix.os == 'ubuntu-22.04' |
77 | | - run: swift test |
78 | | - - name: Test macOS |
79 | | - if: matrix.os == 'macos-latest' |
80 | | - run: swift test --skip K8s |
| 56 | + |
| 57 | + ios: |
| 58 | + runs-on: macOS-latest |
| 59 | + strategy: |
| 60 | + matrix: |
| 61 | + destination: |
| 62 | + - "platform=iOS Simulator,OS=18.5,name=iPad Pro 13-inch (M4)" |
| 63 | + steps: |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v5 |
| 66 | + - name: Build |
| 67 | + run: set -o pipefail && xcodebuild -scheme SwiftkubeClient -destination "${{ matrix.destination }}" clean build | xcpretty |
0 commit comments