webbrowser 0.7.1

Open URLs in web browsers available on a platform
Documentation
name: Android

on:
  push:
    branches-ignore: [ '**win**', '**linux**', '**macos**', '**bsd**', '**haiku**', '**wasm**', '**ios**' ]
  pull_request:
    branches: [ master ]

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  CARGO_APK_VERSION: '0.8.2'

jobs:
  build:
    name: Build
    runs-on: macos-latest
    strategy:
      matrix:
        rust: [stable ]
        api-level: [ 29 ]
        ndk-version: [ '22.1.7171670' ]
        cmake-version: [ '3.18.1' ]
    continue-on-error: ${{ matrix.rust != 'stable' }}
    steps:
      - uses: actions/checkout@v2
        name: Checkout
      - uses: actions-rs/toolchain@v1
        name: Install Rust Toolchain
        with:
          profile: minimal
          toolchain: ${{ matrix.rust }}
          target: i686-linux-android
          override: true
          components: rustfmt, clippy

      # Install cargo-apk
      - uses: actions/cache@v2
        name: Fetch cargo-apk from cache
        id: cargo-apk-cache
        with:
          path: ~/.cargo/bin/cargo-apk
          key: cargo-apk-${{ env.CARGO_APK_VERSION }}
      - name: Install cargo-apk
        if: steps.cargo-apk-cache.outputs.cache-hit != 'true'
        uses: actions-rs/install@v0.1
        with:
          crate: cargo-apk
          version: ${{ env.CARGO_APK_VERSION }}
          use-tool-cache: false

      # Compile
      - uses: actions-rs/cargo@v1
        name: Compile
        with:
          command: build

      # Check if AVD is in cache, else create AVD
      - name: AVD cache
        uses: actions/cache@v2
        id: avd-cache
        with:
          path: |
            ~/.android/avd/*
            ~/.android/adb*
          key: avd-${{ matrix.api-level }}
      - name: Create AVD
        if: steps.avd-cache.outputs.cache-hit != 'true'
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          force-avd-creation: false
          emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: false
          script: echo "Generated AVD snapshot for caching."

      # Run tests on emulator
      - name: run tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          ndk: ${{ matrix.ndk-version }}
          cmake: ${{ matrix.cmake-version }}
          force-avd-creation: false
          emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: true
          script: bash -c 'ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/${{ matrix.ndk-version }} cargo test --test test_android -- --ignored'

      # Code format, linting etc.
      - uses: actions-rs/cargo@v1
        name: Check Code Formatting
        with:
          command: fmt
          args: --all -- --check
      - uses: actions-rs/cargo@v1
        name: Lints
        with:
          command: clippy
          args: --all-targets -- -D warnings