Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add CI #12

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions .github/workflows/validate.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: "Validate"
name: "CI"

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches:
- "main"
pull_request:
branches:
- "main"

env:
DEFAULT_PYTHON: "3.12"

jobs:
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
name: "Hassfest Validation"
Expand All @@ -35,3 +36,26 @@ jobs:
category: "integration"
# Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands
ignore: "brands"

tests:
runs-on: "ubuntu-latest"
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/[email protected]"
- name: Setup Python ${{ env.DEFAULT_PYTHON }}
uses: "actions/[email protected]"
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: |
pip install pip
pip install -r requirements_test.txt
- name: Tests suite
run: |
pytest -p no:sugar
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
env_vars: OS,PYTHON
verbose: true
4 changes: 2 additions & 2 deletions tests/test_proxy_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ async def test_headers(
hass_client_no_auth: Any,
) -> None:
"""Test proxy headers are added and respected."""
unauthenticated_hass_client = await hass_client_no_auth()

await register_test_view(hass, proxied_url=ProxiedURL(url=f"{local_server}ok"))

unauthenticated_hass_client = await hass_client_no_auth()

resp = await unauthenticated_hass_client.get(
TEST_PROXY_URL,
headers={hdrs.CONTENT_ENCODING: "foo"},
Expand Down
Loading