-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2654 from alandtse/dev
- Loading branch information
Showing
15 changed files
with
2,979 additions
and
1,443 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "Install poetry and dependencies" | ||
description: "Install poetry and dependencies" | ||
inputs: | ||
directory: | ||
description: "Directory where you want to run poetry install" | ||
required: false | ||
default: "./" | ||
python_version: | ||
description: "Python version to use" | ||
required: false | ||
default: "3.12" | ||
poetry_version: | ||
description: "Poetry version to use" | ||
required: false | ||
default: "1.8.2" | ||
cache_dependencies: | ||
description: "Whether the dependencies must be cached" | ||
required: false | ||
default: "true" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python_version }} | ||
- name: Load cached Poetry installation | ||
id: cached-poetry | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
key: poetry-${{ inputs.poetry_version }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ inputs.poetry_version }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
- name: cache dependencies | ||
if: inputs.cache_dependencies == 'true' | ||
id: cache-deps | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: pydeps-${{ hashFiles(format('{0}/poetry.lock', inputs.directory)) }} | ||
- name: Install dependencies | ||
shell: bash | ||
run: cd $INPUT_DIRECTORY; poetry install --no-interaction --no-root | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
env: | ||
INPUT_DIRECTORY: ${{ inputs.directory }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- "**.py" | ||
pull_request: | ||
paths: | ||
- "**.py" | ||
- "poetry.lock" | ||
|
||
jobs: | ||
tests: | ||
runs-on: "ubuntu-latest" | ||
name: Run tests | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- uses: ./.github/workflows/poetry-composite-action | ||
- name: Prepare test env | ||
run: bash tests/setup.sh | ||
- name: Install poetry | ||
run: poetry install | ||
- name: Run tests | ||
run: | | ||
poetry run pytest \ | ||
-qq \ | ||
--timeout=9 \ | ||
--durations=10 \ | ||
-n auto \ | ||
--cov custom_components.alexa_media \ | ||
--cov-report xml \ | ||
-o console_output_style=count \ | ||
-p no:sugar \ | ||
tests | ||
poetry run coverage lcov | ||
- name: Upload Coverage Results | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
path-to-lcov: coverage.lcov |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,3 +106,5 @@ venv.bak/ | |
# macOS files | ||
._* | ||
.DS_Store | ||
coverage.lcov | ||
custom_components/test |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.