Skip to content

Fix and update GitHub Actions workflow for Xcode builds #94

Fix and update GitHub Actions workflow for Xcode builds

Fix and update GitHub Actions workflow for Xcode builds #94

Workflow file for this run

name: Xcode
on: [push]
jobs:
ios:
name: "Xcode ${{ matrix.env.xcode }}, ${{ matrix.env.runtime }}, ${{ matrix.env.device }}"
runs-on: macOS-14
strategy:
matrix:
env:
- xcode: 15.4
runtime: "iOS 17.5"
device: "iPhone 15 Pro Max"
- xcode: 15.4
runtime: "iOS 16.4"
device: "iPhone 12 mini"
- xcode: 15.4
runtime: "iOS 15.5"
device: "iPhone SE"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Select Xcode ${{ matrix.env.xcode }}"
uses: ./.github/actions/xcode-select
with:
version: ${{ matrix.env.xcode }}
- name: "Cache downloaded simulator runtimes"
uses: actions/cache@v4
with:
path: ~/Downloads/*.dmg
key: Xcode ${{ matrix.env.xcode }}+${{ matrix.env.runtime }}
- name: "Prepare simulator"
id: prepare-simulator
uses: ./.github/actions/prepare-simulator
with:
runtime: ${{ matrix.env.runtime }}
device: ${{ matrix.env.device }}
- name: "Build and test"
run: |
set -o pipefail
xcodebuild test -project "OneTimePassword.xcodeproj" -scheme "OneTimePassword (iOS)" -destination "id=${{ steps.prepare-simulator.outputs.destination-id }}" | xcpretty -c
- uses: sersoft-gmbh/swift-coverage-action@v4
with:
target-name-filter: ^OneTimePassword$
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
watchos:
name: "Xcode ${{ matrix.env.xcode }}, ${{ matrix.env.runtime }}, ${{ matrix.env.device }}"
runs-on: macOS-14
strategy:
matrix:
env:
- xcode: 15.4
runtime: "watchOS 10.5"
device: "Apple Watch Ultra 2 (49mm)"
- xcode: 15.4
runtime: "watchOS 9.4"
device: "Apple Watch SE (44mm) (2nd generation)"
- xcode: 15.4
runtime: "watchOS 8.5"
device: "Apple Watch Series 3 (38mm)"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Select Xcode ${{ matrix.env.xcode }}"
uses: ./.github/actions/xcode-select
with:
version: ${{ matrix.env.xcode }}
- name: "Cache downloaded simulator runtimes"
uses: actions/cache@v4
with:
path: ~/Downloads/*.dmg
key: Xcode ${{ matrix.env.xcode }}+${{ matrix.env.runtime }}
- name: "Prepare simulator"
id: prepare-simulator
uses: ./.github/actions/prepare-simulator
with:
runtime: ${{ matrix.env.runtime }}
device: ${{ matrix.env.device }}
- name: "Build"
run: |
set -o pipefail
xcodebuild build -project "OneTimePassword.xcodeproj" -scheme "OneTimePassword (watchOS)" -destination "id=${{ steps.prepare-simulator.outputs.destination-id }}" | xcpretty -c