testing suits for iOS & Android #148
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: CI | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
env: | |
RUSTFLAGS: -Dwarnings | |
RUST_BACKTRACE: 1 | |
jobs: | |
rustfmt: | |
name: rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: sfackler/actions/rustup@master | |
- uses: sfackler/actions/rustfmt@master | |
windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
name: test-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: sfackler/actions/rustup@master | |
with: | |
version: 1.65.0 | |
- run: echo "::set-output name=version::$(rustc --version)" | |
id: rust-version | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry/index | |
key: index-${{ runner.os }}-${{ github.run_number }} | |
restore-keys: | | |
index-${{ runner.os }}- | |
- run: cargo generate-lockfile | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry/cache | |
key: registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
- run: cargo fetch | |
- uses: actions/cache@v1 | |
with: | |
path: target | |
key: target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
- run: cargo test --features vendored | |
build_n_test_ios: | |
strategy: | |
fail-fast: false | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install cargo lipo and rust compiler for ios target | |
if: ${{ !cancelled() }} | |
run: | | |
cargo install --locked cargo-lipo | |
rustup target add x86_64-apple-ios aarch64-apple-ios | |
- name: clippy | |
if: ${{ !cancelled() }} | |
run: cargo clippy --target x86_64-apple-ios --all-features -- -D warnings | |
- name: Build | |
if: ${{ !cancelled() }} | |
run: | | |
cargo lipo --verbose --all-features | |
- name: Abort on error | |
if: ${{ failure() }} | |
run: echo "iOS build job failed" && false |