webbrowser 1.2.1

Open URLs in web browsers available on a platform
Documentation
name: iOS

on:
  push:
    branches-ignore: [ '**win**', '**android**', '**linux**', '**bsd**', '**haiku**', '**wasm**', '**macos**' ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '0 0 1 * *'

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-15
    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 16.2
        run: sudo xcode-select -s /Applications/Xcode_16.2.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=$(xcrun simctl list runtimes | grep SimRuntime.iOS | awk '{ print $NF }' | egrep 'iOS-[0-9]{2}-' | sort | tail -n 1)
          IOSDEV=$(xcrun simctl list 2>&1 | grep com.apple.CoreSimulator.SimDeviceType.iPhone | awk '{ print $NF }' | tr -d '()' | egrep 'iPhone-[0-9]{2}$' | sort | tail -n 1)
          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