77 branches : ["master"]
88
99env :
10- POETRY_VERSION : 1.7.1
11- TOX_VERSION : 4.11.3
12- COVERALLS_VERSION : 3.3.1
10+ POETRY_VERSION : 1.8.2
1311
1412jobs :
1513 linting :
@@ -20,44 +18,16 @@ jobs:
2018 python-version : ["3.12"]
2119 steps :
2220 - uses : " actions/checkout@v4"
23- - uses : " actions/setup-python@v5 "
24- id : setup-python
21+ - name : Setup environment
22+ uses : ./.github/actions/ setup
2523 with :
26- python-version : " ${{ matrix.python-version }}"
27- cache : ' pip'
28- cache-dependency-path : |
29- pyproject.toml
30- .github/workflows/ci.yml
31- - name : Install dependencies
32- run : |
33- pipx install poetry==$POETRY_VERSION
34- pipx install tox==$TOX_VERSION
35- - name : Read poetry cache location
36- id : poetry-cache-location
37- shell : bash
38- run : |
39- echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
40- - name : Poetry cache
41- uses : actions/cache@v3
42- with :
43- path : |
44- ${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
45- key : linting-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
46- - name : Read pre-commit version
47- id : pre-commit-version
48- run : >-
49- echo "PRE_COMMIT_VERSION=$(poetry run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT
50- - name : Pre-commit cache
51- uses : actions/cache@v3
52- with :
53- path : ~/.cache/pre-commit/
54- key : ${{ runner.os }}-pre-commit-${{ steps.pre-commit-version.outputs.PRE_COMMIT_VERSION }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
55- - name : Lint with tox
24+ python-version : ${{ matrix.python-version }}
25+ poetry-version : ${{ env.POETRY_VERSION }}
26+ poetry-install-options : " --sync --extras listen --verbose"
27+ cache-pre-commit : true
28+ - name : " Run pre-commit checks"
5629 run : |
57- poetry env use python
58- tox
59- env :
60- TOXENV : lint
30+ poetry run pre-commit run --all-files
6131
6232 docs :
6333 name : " Build docs"
@@ -68,34 +38,15 @@ jobs:
6838 python-version : ["3.12"]
6939 steps :
7040 - uses : " actions/checkout@v4"
71- - uses : " actions/setup-python@v5"
72- id : setup-python
73- with :
74- python-version : " ${{ matrix.python-version }}"
75- cache : ' pip'
76- cache-dependency-path : |
77- pyproject.toml
78- .github/workflows/ci.yml
79- - name : Install dependencies
80- run : |
81- pipx install poetry==$POETRY_VERSION
82- pipx install tox==$TOX_VERSION
83- - name : Read poetry cache location
84- id : poetry-cache-location
85- shell : bash
86- run : |
87- echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
88- - uses : actions/cache@v3
41+ - name : Setup environment
42+ uses : ./.github/actions/setup
8943 with :
90- path : |
91- ${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
92- key : docs-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
93- - name : Make docs with tox
44+ python-version : ${{ matrix.python-version }}
45+ poetry-version : ${{ env.POETRY_VERSION }}
46+ poetry-install-options : " --sync --extras docs --without dev "
47+ - name : Make docs poetry
9448 run : |
95- poetry env use python
96- tox
97- env :
98- TOXENV : docs
49+ poetry run make -C docs html
9950
10051 tests :
10152 name : tests
@@ -111,51 +62,18 @@ jobs:
11162 - " 3.11"
11263 - " 3.12"
11364 steps :
114- - uses : actions/checkout@v4
115- - name : Set up Python ${{ matrix.python-version }}
116- uses : actions/setup-python@v5
117- id : setup-python
65+ - uses : " actions/checkout@v4"
66+ - name : Setup environment
67+ uses : ./.github/actions/setup
11868 with :
11969 python-version : ${{ matrix.python-version }}
120- cache : ' pip'
121- cache-dependency-path : |
122- pyproject.toml
123- .github/workflows/ci.yml
124- - name : " Install dependencies"
125- run : |
126- pipx install poetry==$POETRY_VERSION
127- pipx install tox==$TOX_VERSION
128- pipx install coveralls==$COVERALLS_VERSION
129- - name : Read poetry cache location
130- id : poetry-cache-location
131- shell : bash
132- run : |
133- echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
134- - uses : actions/cache@v3
135- with :
136- path : |
137- ${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
138- key : test-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
139- - name : Prepare toxenv
140- id : toxenv
141- run : |
142- if [[ '${{ matrix.python-version }}' == '3.8' ]]; then
143- echo "::set-output name=toxenv::py38"
144- elif [[ '${{ matrix.python-version }}' == '3.9' ]]; then
145- echo "::set-output name=toxenv::py39"
146- elif [[ '${{ matrix.python-version }}' == '3.10' ]]; then
147- echo "::set-output name=toxenv::py310"
148- elif [[ '${{ matrix.python-version }}' == '3.11' ]]; then
149- echo "::set-output name=toxenv::py311"
150- else
151- echo "::set-output name=toxenv::py312"
152- fi
153- - name : Test with tox
154- run : |
155- poetry env use python
156- tox
157- env :
158- TOXENV : ${{ steps.toxenv.outputs.toxenv }}
70+ poetry-version : ${{ env.POETRY_VERSION }}
71+ poetry-install-options : " --sync --extras listen"
72+ - name : Run tests
73+ run : >
74+ poetry run pytest tests/
75+ --cov=ring_doorbell --cov-report=xml
76+ --cov-report=term-missing --import-mode importlib
15977 - name : Coveralls GitHub Action
16078 uses : coverallsapp/github-action@v2.2.3
16179 with :
0 commit comments