name: Build

on:
  pull_request:
    types: [opened, synchronize, reopened]
  push:
    branches:
      - main

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        include:
          - rust_target: "x86_64-unknown-linux-gnu"
          - rust_target: "x86_64-linux-android"

    steps:
      - uses: actions/checkout@v3

      - name: Install Rust Stable
        run: |
          rustup override set stable
          rustup update stable
          rustup target add ${{ matrix.rust_target }}

      - name: Build test for ${{ matrix.rust_target }}
        run: cargo build --target ${{ matrix.rust_target }}
