name: OSX

on:
  pull_request:
    branches: [main]
  workflow_dispatch:

jobs:
  cross:
    name: Rust ${{matrix.target}}
    runs-on: macos-latest
    strategy:
      fail-fast: false
      matrix:
        target:
          # iOS targets don't work, since rust-embedded doesn't provide images.
          - x86_64-apple-darwin

    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          target: ${{matrix.target}}
          override: true
      - uses: actions-rs/cargo@v1
        with:
          use-cross: true
          command: check
          args: --target ${{matrix.target}}
      - uses: actions-rs/cargo@v1
        with:
          use-cross: true
          command: test
          args: --target ${{matrix.target}}
      - uses: actions-rs/cargo@v1
        with:
          use-cross: true
          command: test
          args: --target ${{matrix.target}} --features=compact
