|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, develop ] |
| 6 | + pull_request: |
| 7 | + branches: [ main, develop ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 15 | + python-version: ["3.10", "3.11", "3.12"] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v4 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + python -m pip install --upgrade pip |
| 28 | + pip install -e . |
| 29 | + pip install -r requirements-dev.txt |
| 30 | + |
| 31 | + - name: Check Python version compatibility |
| 32 | + run: | |
| 33 | + python check_python_version.py |
| 34 | + |
| 35 | + - name: Lint with flake8 |
| 36 | + run: | |
| 37 | + # stop the build if there are Python syntax errors or undefined names |
| 38 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 39 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 40 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 41 | + |
| 42 | + - name: Type check with mypy |
| 43 | + run: | |
| 44 | + mypy hello_agents --ignore-missing-imports |
| 45 | + |
| 46 | + - name: Test with pytest |
| 47 | + run: | |
| 48 | + pytest tests/ -v --cov=hello_agents --cov-report=xml |
| 49 | + |
| 50 | + - name: Upload coverage to Codecov |
| 51 | + uses: codecov/codecov-action@v3 |
| 52 | + with: |
| 53 | + file: ./coverage.xml |
| 54 | + flags: unittests |
| 55 | + name: codecov-umbrella |
| 56 | + fail_ci_if_error: false |
0 commit comments