Skip to content

Commit

Permalink
Merge pull request #12 from dermotduffy/miserable-blackbird
Browse files Browse the repository at this point in the history
Add CI
  • Loading branch information
dermotduffy authored Oct 22, 2024
2 parents dc2840d + 1502ad4 commit de6266a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
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

0 comments on commit de6266a

Please sign in to comment.