up tox env version #176
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: CI | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install uv with Python | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: 3.13 | |
| - name: Install the project | |
| run: uv sync --extra linting | |
| - name: ruff-lint | |
| run: uv run ruff check | |
| - name: ruff-format | |
| run: uv run ruff format --check | |
| test: | |
| needs: lint | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: ${{ matrix.experimental }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Test suite with py311-ubuntu | |
| python: "3.11" | |
| os: ubuntu-latest | |
| toxenv: py311 | |
| experimental: false | |
| - name: Test suite with py312-ubuntu | |
| python: "3.12" | |
| os: ubuntu-latest | |
| toxenv: py312 | |
| experimental: false | |
| - name: Test suite with py313-ubuntu | |
| python: "3.13" | |
| os: ubuntu-latest | |
| toxenv: py313 | |
| experimental: false | |
| - name: Test suite with py314-ubuntu | |
| python: "3.14" | |
| os: ubuntu-latest | |
| toxenv: py314 | |
| experimental: true | |
| - name: Codacy Coverage Report | |
| python: "3.13" | |
| os: ubuntu-latest | |
| toxenv: coverage | |
| experimental: false | |
| name: ${{ matrix.name }} | |
| env: | |
| # Color Output | |
| # Rich (pip) | |
| FORCE_COLOR: 1 | |
| # Tox | |
| PY_COLORS: 1 | |
| # MyPy | |
| TERM: xterm-color | |
| MYPY_FORCE_COLOR: 1 | |
| MYPY_FORCE_TERMINAL_WIDTH: 200 | |
| # Pytest | |
| PYTEST_ADDOPTS: "--color=yes" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| check-latest: true | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Setup tox environment | |
| run: tox -e ${{ matrix.toxenv }} --notest | |
| - name: Test | |
| run: tox -e ${{ matrix.toxenv }} --skip-pkg-install | |
| - name: Run codacy-coverage-reporter | |
| if: ${{ matrix.toxenv == 'coverage' && github.repository == 'pastas/metran' && success() }} | |
| uses: codacy/codacy-coverage-reporter-action@master | |
| with: | |
| project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
| coverage-reports: coverage.xml |