2022-07-10 10:54:16 +10:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-08-01 12:23:24 +10:00
|
|
|
branches: [master, trunk]
|
2022-07-10 10:54:16 +10:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
fmt:
|
|
|
|
name: Check formatting
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-12 03:18:11 +10:00
|
|
|
- uses: actions/checkout@v4
|
2022-07-10 10:54:16 +10:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
|
|
|
override: true
|
|
|
|
- name: Check formatting
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: -- --check
|
2022-08-15 06:40:38 +10:00
|
|
|
test:
|
|
|
|
name: Check that examples build
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2023-09-12 03:18:11 +10:00
|
|
|
- uses: actions/checkout@v4
|
2022-08-15 06:40:38 +10:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2022-08-01 12:23:24 +10:00
|
|
|
build:
|
|
|
|
name: Check that the code builds
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2023-09-12 03:18:11 +10:00
|
|
|
- uses: actions/checkout@v4
|
2022-08-01 12:23:24 +10:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
examples:
|
|
|
|
name: Check that examples build
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2023-09-12 03:18:11 +10:00
|
|
|
- uses: actions/checkout@v4
|
2022-08-01 12:23:24 +10:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
2022-08-01 14:06:49 +10:00
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2022-08-15 05:48:50 +10:00
|
|
|
args: --features webview --example webview_custom_protocol
|
2022-08-21 15:32:29 +10:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
target: x86_64-apple-ios
|
2022-08-19 15:32:48 +10:00
|
|
|
# Since it's all Objective-C message passing under the hood, we're
|
2022-08-19 15:25:00 +10:00
|
|
|
# really just looking for whether we've broken the iOS build. It is likely
|
|
|
|
# that more robust tests/checking infrastructure should exist for this side
|
|
|
|
# of things as the iOS portion gets iterated on.
|
|
|
|
#
|
|
|
|
# (e.g, this at the moment will not catch invalid selector calls, like if an appkit-specific
|
|
|
|
# selector is used for something on iOS)
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2022-08-21 15:32:29 +10:00
|
|
|
args: --target x86_64-apple-ios --example ios-beta --no-default-features --features uikit,autolayout
|
2022-08-21 15:03:56 +10:00
|
|
|
|
|
|
|
ios:
|
2022-08-21 15:19:06 +10:00
|
|
|
name: Check that iOS tests pass via dinghy.
|
2022-08-21 15:03:56 +10:00
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2022-08-22 09:36:47 +10:00
|
|
|
|
|
|
|
- name: Install cargo-dinghy
|
2023-03-24 20:14:39 +11:00
|
|
|
uses: baptiste0928/cargo-install@v2
|
2022-08-22 09:36:47 +10:00
|
|
|
with:
|
|
|
|
crate: cargo-dinghy
|
|
|
|
|
2023-09-12 03:18:11 +10:00
|
|
|
- uses: actions/checkout@v4
|
2022-08-21 15:03:56 +10:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
target: x86_64-apple-ios
|
|
|
|
|
|
|
|
- name: Launch XCode Simulator and prepare Dinghy
|
|
|
|
run: |
|
|
|
|
# Get system info
|
|
|
|
xcrun simctl list runtimes
|
|
|
|
# Launch the simulator
|
|
|
|
RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1)
|
2022-11-05 12:17:24 +11:00
|
|
|
SIM_ID=$(xcrun simctl create My-iphone-se com.apple.CoreSimulator.SimDeviceType.iPhone-14 $RUNTIME_ID)
|
2022-08-21 15:03:56 +10:00
|
|
|
xcrun simctl boot $SIM_ID
|
|
|
|
|
|
|
|
- name: Dinghy test
|
|
|
|
run: |
|
|
|
|
cargo dinghy --platform auto-ios-x86_64 test --no-default-features --features uikit,autolayout
|