Skip to content

Run tests on different OS versions #50

Run tests on different OS versions

Run tests on different OS versions #50

Workflow file for this run

name: Run Unit Tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
runs-on: "macos-${{ matrix.macos-version || 'latest' }}"
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
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
- name: Use Latest Stable Xcode
uses: maxim-lobanov/setup-xcode@v1
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@os-version
with:
workspace: ".swiftpm/xcode/package.xcworkspace"
scheme: "KSCrash-Package"
platform: ${{ matrix.platform }}
os-version: ${{ matrix.os-version }}