name: Unit and E2E Testing
on:
  push:
    branches:
      - "dev"
      - "master"
  pull_request:
    branches:
      - "dev"
      - "master"
jobs:
  testing:
    name: Code Testing
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@master
        with:
          python-version: 3.9

      - name: Preparing the environment
        run: |
          python -m pip install --upgrade pip
          if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; else python -m pip install beautifulsoup4 requests pydantic; fi

      - name: Starting Testing Suites
        run: |
          python -m pytest ./tests