Replace k3d with minikube for testing and update ci workflow #142
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "swiftkube-client-ci" | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "*" ] | |
jobs: | |
swiftformat-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install SwiftFormat | |
uses: Cyberbeni/install-swift-tool@v2 | |
with: | |
url: https://github.com/nicklockwood/SwiftFormat | |
- name: Lint Sources | |
run: swiftformat --lint Sources | |
iOS: | |
name: Test iOS | |
runs-on: macOS-latest | |
strategy: | |
matrix: | |
destination: | |
- "platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro" | |
- "platform=iOS Simulator,OS=18.2,name=iPhone 16 Pro" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: iOS - ${{ matrix.destination }} | |
run: set -o pipefail && xcodebuild -scheme SwiftkubeClient -destination "${{ matrix.destination }}" clean build | xcpretty | |
build: | |
name: Swift ${{ matrix.swift }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
swift: ["5.9", "5.10", "6.0"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: SPM Cache | |
uses: actions/cache@v2 | |
with: | |
path: .build | |
key: ${{ matrix.os }}-${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ matrix.swift }}- | |
- name: Start minikube | |
uses: medyagh/setup-minikube@latest | |
id: minikube | |
with: | |
minikube-version: 1.35.0 | |
- uses: swift-actions/setup-swift@v2 | |
with: | |
swift-version: ${{ matrix.swift }} | |
- name: Get swift version | |
run: swift --version | |
- name: Build | |
run: swift build | |
- name: Test | |
run: swift test |