From 59df72e0770e6f0a8e4387fb5ec5e75e9202d848 Mon Sep 17 00:00:00 2001 From: Max Winterstein Date: Sun, 29 Dec 2024 20:58:31 +0100 Subject: [PATCH] CI: Add code checks to MR --- .github/workflows/pr.yaml | 12 ++++++++++++ toogoodtogo_ha_mqtt_bridge/tests/test_cron.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..666a1ef --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,12 @@ +name: Check MR + +on: [pull_request] + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: pkgxdev/setup@v1 + - run: pkgx +task task check diff --git a/toogoodtogo_ha_mqtt_bridge/tests/test_cron.py b/toogoodtogo_ha_mqtt_bridge/tests/test_cron.py index 486cd11..6b71f52 100644 --- a/toogoodtogo_ha_mqtt_bridge/tests/test_cron.py +++ b/toogoodtogo_ha_mqtt_bridge/tests/test_cron.py @@ -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")