actions: Create workflow build and test #4
Workflow file for this run
This file contains 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: iOS build and test workflow | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
SCHEME: CryptoWidgetKitApp | |
TEST_SCHEME: CryptoWidgetKitAppTests | |
SIMULATOR: "iPhone 15" | |
jobs: | |
build: | |
name: Build and test using Xcode ${{ matrix.xcode_version }} iOS ${{ matrix.os_version }} | |
runs-on: macos-14 | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: true | |
matrix: | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators | |
xcode_version: [ "15.0.1", "15.4" ] | |
os_version: [ "17.0.1", "17.5" ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Xcode | |
uses: maxim-lobanov/setup-xcode@v1.6.0 | |
with: | |
xcode-version: ${{ matrix.xcode_version }} | |
- name: Build | |
run: | | |
# https://mokacoding.com/blog/xcodebuild-destination-options/ | |
xcodebuild \ | |
-scheme "$SCHEME" \ | |
-destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \ | |
clean build | |
- name: Test | |
run: | | |
xcodebuild \ | |
-scheme "$TEST_SCHEME" \ | |
-destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \ | |
test |