Skip to content

Commit

Permalink
CI: Add code checks to MR
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWinterstein committed Dec 29, 2024
1 parent 0b2e752 commit c7b2daf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check MR

on: [pull_request]

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pkgxdev/setup@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Allow uv to use the system Python by default
run: echo "UV_SYSTEM_PYTHON=1" >> $GITHUB_ENV
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Install the project
run: uv sync --all-extras --dev
- run: . .venv/bin/activate
- run: pkgx +task task check:mypy
2 changes: 1 addition & 1 deletion toogoodtogo_ha_mqtt_bridge/tests/test_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
("2022-11-12 20:54:44", "*/10 7-20 * * *", "2022-11-13 07:00:00"),
],
)
def test_calc_next_run(_time, _cron, expected):
def test_calc_next_run(_time, _cron, expected) -> None:
expected_date = dt.datetime.strptime(expected, "%Y-%m-%d %H:%M:%S")
time_date = dt.datetime.strptime(_time, "%Y-%m-%d %H:%M:%S")

Expand Down

0 comments on commit c7b2daf

Please sign in to comment.