| 1 |
name: Test Rich module |
| 2 |
|
| 3 |
on: [pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
build: |
| 7 |
runs-on: ${{ matrix.os }} |
| 8 |
strategy: |
| 9 |
fail-fast: false |
| 10 |
matrix: |
| 11 |
os: [windows-latest, ubuntu-latest, macos-latest] |
| 12 |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 13 |
exclude: |
| 14 |
- { os: windows-latest, python-version: "3.13" } |
| 15 |
defaults: |
| 16 |
run: |
| 17 |
shell: bash |
| 18 |
steps: |
| 19 |
- uses: actions/checkout@v4 |
| 20 |
- name: Set up Python ${{ matrix.python-version }} |
| 21 |
uses: actions/setup-python@v5 |
| 22 |
with: |
| 23 |
python-version: ${{ matrix.python-version }} |
| 24 |
allow-prereleases: true |
| 25 |
- name: Install and configure Poetry |
| 26 |
# TODO: workaround for https://github.com/snok/install-poetry/issues/94 |
| 27 |
uses: snok/[email protected] |
| 28 |
with: |
| 29 |
version: 1.3.1 |
| 30 |
virtualenvs-in-project: true |
| 31 |
- name: Install dependencies |
| 32 |
run: poetry install |
| 33 |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' |
| 34 |
- name: Format check with black |
| 35 |
run: | |
| 36 |
source $VENV |
| 37 |
make format-check |
| 38 |
- name: Typecheck with mypy |
| 39 |
run: | |
| 40 |
source $VENV |
| 41 |
make typecheck |
| 42 |
- name: Test with pytest (with coverage) |
| 43 |
run: | |
| 44 |
source $VENV |
| 45 |
pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing |
| 46 |
- name: Upload code coverage |
| 47 |
uses: codecov/codecov-action@v4 |
| 48 |
with: |
| 49 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 50 |
file: ./coverage.xml |
| 51 |
name: rich |
| 52 |
flags: unittests |
| 53 |
env_vars: OS,PYTHON |