Skip to content

Commit

Permalink
Merge a277d90 into 5444042
Browse files Browse the repository at this point in the history
  • Loading branch information
sdb9696 committed Mar 18, 2024
2 parents 5444042 + a277d90 commit c113da7
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 27 deletions.
81 changes: 58 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,36 @@ 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"
id: setup-python
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
- name: Read poetry cache location
id: poetry-cache-location
shell: bash
run: |
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
echo "::notice::poetry project venv $(poetry env info --path)"
- 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: |
poetry env use python
tox
env:
TOXENV: lint
- name: Check path
run: |
echo "::notice::poetry project venv $(poetry env info --path)"
docs:
name: "Build docs"
Expand All @@ -44,19 +58,29 @@ 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"
id: setup-python
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: |
poetry env use python
tox
env:
TOXENV: docs
Expand All @@ -75,19 +99,29 @@ 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
id: setup-python
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
pipx install coveralls==$COVERALLS_VERSION
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: |
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
echo $POETRY_VENV_LOCATION
- 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 All @@ -104,6 +138,7 @@ jobs:
fi
- name: Test with tox
run: |
poetry env use python
tox
env:
TOXENV: ${{ steps.toxenv.outputs.toxenv }}
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 --verbose
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 c113da7

Please sign in to comment.