Skip to content

Commit

Permalink
Merge 641052b into 5444042
Browse files Browse the repository at this point in the history
  • Loading branch information
sdb9696 committed Mar 18, 2024
2 parents 5444042 + 641052b commit d03e436
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 29 deletions.
74 changes: 49 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,25 @@ jobs:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
cache: 'pip'
- name: Install dependencies
run: |
pip install poetry==$POETRY_VERSION
pip install tox==$TOX_VERSION
- name: Read poetry cache location
id: poetry-cache-location
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: |
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
key: linting-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Lint with tox
run: |
tox
Expand All @@ -44,17 +52,25 @@ jobs:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
pip install poetry==$POETRY_VERSION
pip install tox==$TOX_VERSION
- name: Read poetry cache location
id: poetry-cache-location
shell: bash
run: |
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: |
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
key: docs-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Make docs with tox
run: |
tox
Expand All @@ -75,19 +91,27 @@ jobs:
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
cache: 'pip'
- name: "Install dependencies"
run: |
pip install poetry==$POETRY_VERSION
pip install tox==$TOX_VERSION
pip install coveralls==$COVERALLS_VERSION
- name: Read poetry cache location
id: poetry-cache-location
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
pipx install coveralls==$COVERALLS_VERSION
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: |
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
key: test-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Prepare toxenv
id: toxenv
run: |
Expand Down
11 changes: 7 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ skip_missing_interpreters = True
isolated_build = true

[testenv]
skip_install = true
allowlist_externals = poetry
commands_pre =
poetry install --no-root --sync --extras listen
poetry install --sync --extras listen
commands =
poetry run pytest tests/ --cov=ring_doorbell --cov-report=xml --cov-report=term-missing
poetry run pytest tests/ --cov=ring_doorbell --cov-report=xml --cov-report=term-missing --import-mode importlib

[testenv:lint]
skip_install = true
allowlist_externals = poetry
commands_pre =
poetry install --no-root --sync --extras listen
poetry install --sync --extras listen
ignore_errors = True
commands =
poetry run pre-commit run --all-files

[testenv:docs]
skip_install = true
allowlist_externals =
poetry
make
commands_pre =
poetry install --no-root --sync --extras docs --without dev
poetry install --sync --extras docs --without dev
ignore_errors = True
commands =
poetry run make -C docs html

0 comments on commit d03e436

Please sign in to comment.