cacao/.github/workflows/ci.yml

107 lines
2.9 KiB
YAML
Raw Normal View History

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:
- uses: actions/checkout@v2
- 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:
- uses: actions/checkout@v2
- 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:
- uses: actions/checkout@v2
- 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:
- uses: actions/checkout@v2
- 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
# Since it's all Objective-C message passing under the hood, we're
# 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
ios:
2022-08-21 15:19:06 +10:00
name: Check that iOS tests pass via dinghy.
runs-on: macos-latest
steps:
- name: Install cargo-dinghy
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-dinghy
- uses: actions/checkout@v2
- 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-08-21 15:28:19 +10:00
SIM_ID=$(xcrun simctl create My-iphone-se com.apple.CoreSimulator.SimDeviceType.iPhone-SE $RUNTIME_ID)
xcrun simctl boot $SIM_ID
- name: Dinghy test
run: |
cargo dinghy --platform auto-ios-x86_64 test --no-default-features --features uikit,autolayout