Skip to content

iOS: Use objc2

iOS: Use objc2 #120

Workflow file for this run

name: iOS
on:
push:
branches-ignore: [ '**win**', '**android**', '**linux**', '**bsd**', '**haiku**', '**wasm**', '**macos**' ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LOG: webbrowser=TRACE
IOS_TARGET: aarch64-apple-ios-sim
jobs:
build:
name: Build
runs-on: macos-latest
if: ${{ !contains(github.event.head_commit.message, '#build-') || contains(github.event.head_commit.message, '#build-ios') }}
strategy:
matrix:
rust: [stable]
continue-on-error: ${{ matrix.rust != 'stable' && matrix.rust != 'beta' }}
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Select Xcode 15.4
run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
- name: Install rust version
run: |
rustup install ${{ matrix.rust }} --profile minimal
rustup component add --toolchain ${{ matrix.rust }} rustfmt clippy
rustup target add ${{ env.IOS_TARGET }}
- name: Configure and start iOS Simulator
run: |
set -e
IOSRUNTIME=com.apple.CoreSimulator.SimRuntime.iOS-17-5
IOSDEV=$(xcrun simctl list 2>&1 | grep com.apple.CoreSimulator.SimDeviceType.iPhone | grep -v ' SE ' | tail -n 1 | tr -d '()' | awk '{ print $NF }')
DEVID=$(xcrun simctl create iphone-latest $IOSDEV $IOSRUNTIME)
echo "==== using device $IOSDEV, $IOSRUNTIME ===="
xcrun simctl boot $DEVID
sleep 10
xcrun simctl list 2>&1
# Run tests
- name: Run tests
run: cargo +${{ matrix.rust }} test --verbose --test test_ios -- --include-ignored --nocapture
env:
TEST_REQ_TIMEOUT: '300'
# Code format, linting etc.
- name: Check Code Formatting
if: ${{ matrix.rust == 'stable' || matrix.rust == 'beta' }}
run: cargo +${{ matrix.rust }} fmt --all -- --check
- name: Lints
if: ${{ matrix.rust == 'stable' || matrix.rust == 'beta' }}
run: cargo +${{ matrix.rust }} clippy --target ${{ env.IOS_TARGET }} -- -D warnings