name: Test

on:
  push:
    branches: ["master"]
  pull_request:
    branches: ["master"]

jobs:
  test:
    runs-on: "${{ matrix.os }}"
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python-version: [3.6, 3.7, 3.8, 3.9]
      fail-fast: true

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install Poetry
        run: pip install poetry
      - name: Install Dependencies
        run: poetry install
      - name: Test
        run: poetry run pytest tests/ --cov=manage_fastapi --cov-report=term-missing:skip-covered --cov-report=xml
      - name: Upload coverage
        uses: codecov/codecov-action@v1
