Skip to content

Commit

Permalink
Run tests on different OS versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bamx23 committed May 9, 2024
1 parent a3c5059 commit def69b7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 23 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/cocoapods-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ jobs:
include:
- platform: iOS
config: ""
- platform: iOS
config: "--use-libraries"
- platform: iOS
config: "--use-libraries --use-modular-headers"
- platform: iOS
config: "--use-static-frameworks"
- platform: macOS
config: ""
- platform: tvOS
config: ""
- platform: watchOS
config: ""
- platform: visionOS
config: ""
# - platform: iOS
# config: "--use-libraries"
# - platform: iOS
# config: "--use-libraries --use-modular-headers"
# - platform: iOS
# config: "--use-static-frameworks"
# - platform: macOS
# config: ""
# - platform: tvOS
# config: ""
# - platform: watchOS
# config: ""
# - platform: visionOS
# config: ""
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
49 changes: 40 additions & 9 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,30 @@ concurrency:

jobs:
unit-tests:
runs-on: macos-latest
runs-on: "macos-${{ matrix.macos-version || 'latest' }}"
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
platform:
- iOS
- macOS
- watchOS
- tvOS
- mac-catalyst
- visionOS
include:
- platform: iOS
- platform: iOS
macos-version: "12"
os-version: ~12.4.0
runtime: "12.4"
# - platform: macOS
# - platform: macOS
# os-version: ~10.14.0
# - platform: watchOS
# - platform: watchOS
# os-version: ~5.0.0
# - platform: tvOS
# - platform: tvOS
# os-version: ~12.0.0
# - platform: mac-catalyst
# - platform: mac-catalyst
# os-version: ~10.14.0
# - platform: visionOS
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -30,9 +42,28 @@ jobs:
with:
xcode-version: latest-stable

- name: Cache
if: ${{ matrix.runtime }}
uses: actions/cache@v3
with:
path: "~/Downloads"
key: ${{ runner.os }}-runtimes-downloads-${{ matrix.platform }}-${{ matrix.runtime }}

- name: Install Simulator
if: ${{ matrix.runtime }}
shell: bash
timeout-minutes: 30
run: sudo xcodes runtimes install --keep-archive '${{ matrix.platform }} ${{ matrix.runtime }}'

- name: Create Simulator
if: ${{ matrix.runtime }}
shell: bash
run: xcrun simctl create 'iPhone X' 'com.apple.CoreSimulator.SimDeviceType.iPhone-X' 'com.apple.CoreSimulator.SimRuntime.iOS-12-4'

- name: Run Unit Tests
uses: bamx23/xcodebuild@vision-os
uses: bamx23/xcodebuild@os-version
with:
workspace: ".swiftpm/xcode/package.xcworkspace"
scheme: "KSCrash-Package"
platform: ${{ matrix.platform }}
os-version: ${{ matrix.os-version }}

0 comments on commit def69b7

Please sign in to comment.