name: Test
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
jobs:
  run:
    runs-on: ubuntu-latest
    name: Test mrfi code coverage
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v2
      name: Setup Python
      with:
        python-version: '3.9'
    - name: Install requirements
      run: |
        pip install -r requirements.txt
        pip install pytest
        pip install pytest-cov
    - name: Run tests and collect coverage
      run: pytest --cov=mrfi --cov-report=xml
    - name: Upload coverage reports to Codecov with GitHub Action
      uses: codecov/codecov-action@v3
      with:
        fail_ci_if_error: true
