name: ci

on:
  push:
    branches:
      - "*"

jobs:
  test:
    name: test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 1

      - name: Install dependencies
        run: |
          python -m pip install -U pip
          pip install -U setuptools wheel pytest

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          profile: minimal
          override: true
          target: ${{ matrix.target }}

      - name: Build wheel
        uses: messense/maturin-action@v1
        with:
          manylinux: auto
          command: build
          args: -m ./examples/path_or_file_like/Cargo.toml -o wheels

      - name: Install wheel
        run: |
          pip install ./wheels/*.whl

      - name: Test
        run: |
          pytest
        working-directory: ./examples/path_or_file_like
