Skip to content

Commit 518c43c

Browse files
committed
Update CI actions
Move swift test into separate workflow
1 parent 57fba83 commit 518c43c

File tree

2 files changed

+85
-58
lines changed

2 files changed

+85
-58
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,67 @@
1-
name: "swiftkube-client-ci"
1+
name: "CI"
22

33
on:
44
push:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "*" ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014

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
3017
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
3526

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
4030
strategy:
4131
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
4444
steps:
4545
- name: Checkout
46-
uses: actions/checkout@v2
46+
uses: actions/checkout@v5
4747
- name: SPM Cache
4848
uses: actions/cache@v4
4949
with:
5050
path: .build
51-
key: ${{ matrix.os }}-${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }}
51+
key: macos-latests-${{ hashFiles('**/Package.resolved') }}
5252
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-
7354
- name: Build
7455
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

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Test"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "*" ]
8+
9+
jobs:
10+
11+
test:
12+
runs-on: ubuntu-latest
13+
continue-on-error: true
14+
strategy:
15+
matrix:
16+
swift: ["5.9", "5.10", "6.0"]
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v5
20+
- name: SPM Cache
21+
uses: actions/cache@v4
22+
with:
23+
path: .build
24+
key: ${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }}
25+
restore-keys: |
26+
${{ matrix.swift }}-
27+
- name: Start minikube
28+
uses: medyagh/setup-minikube@latest
29+
id: minikube
30+
with:
31+
minikube-version: 1.35.0
32+
- uses: swift-actions/setup-swift@v2
33+
with:
34+
swift-version: ${{ matrix.swift }}
35+
- name: Get swift version
36+
run: swift --version
37+
- name: Build
38+
run: swift build
39+
- name: Test
40+
run: swift test

0 commit comments

Comments
 (0)