Improve document workflow #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [ main, develop, staging ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ main, develop ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.14", "3.12", "3.13", "3.9", "3.10", "3.11" ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Lint with flake8 | |
| run: | | |
| # Stop the build if there are Python syntax errors or undefined names | |
| flake8 src/tmo_api --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # Exit-zero treats all errors as warnings | |
| flake8 src/tmo_api --count --exit-zero --max-line-length=88 --extend-ignore=E203,W503 --statistics | |
| - name: Check formatting with black | |
| run: | | |
| black --check src/tmo_api tests/ | |
| - name: Check import sorting with isort | |
| run: | | |
| isort --check-only src/tmo_api tests/ | |
| - name: Type check with mypy | |
| run: | | |
| mypy src/tmo_api --ignore-missing-imports | |
| continue-on-error: true | |
| - name: Run tests with pytest | |
| run: | | |
| pytest tests/ -v --cov=tmo_api --cov-report=xml --cov-report=term | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.13' | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false |