iOS #132
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 | |
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-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.3 | |
run: sudo xcode-select -s /Applications/Xcode_15.3.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-4 | |
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 |