-
Notifications
You must be signed in to change notification settings - Fork 45
60 lines (54 loc) · 2.13 KB
/
ios.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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.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
open -a Simulator
sleep 5
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