Afvalwijzer: Daily Test workflow (xirixiz/homeassistant-afvalwijzer)
The Afvalwijzer: Daily Test workflow from xirixiz/homeassistant-afvalwijzer, explained and optimized by Latchkey.
CI health: A - excellent
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Afvalwijzer: Daily Test workflow from the xirixiz/homeassistant-afvalwijzer repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: "Afvalwijzer: Daily Test"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
test-module:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v7"
- uses: "actions/setup-python@v6"
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: requirements.txt
- run: python3 -m pip install --upgrade pip
- run: python3 -m pip install -r requirements.txt
- name: Enable all addresses
run: sed -i 's/#{"provider"/{"provider"/g' custom_components/afvalwijzer/tests/test_data.py
- name: Test module
run: |
set -o pipefail
scripts/test-module --show-failures-only 2>&1 | tee $GITHUB_STEP_SUMMARY
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: "Afvalwijzer: Daily Test" on: workflow_dispatch: schedule: - cron: "0 0 * * *" jobs: test-module: timeout-minutes: 30 runs-on: "ubuntu-latest" steps: - uses: "actions/checkout@v7" - uses: "actions/setup-python@v6" with: python-version: "3.x" cache: "pip" cache-dependency-path: requirements.txt - run: python3 -m pip install --upgrade pip - run: python3 -m pip install -r requirements.txt - name: Enable all addresses run: sed -i 's/#{"provider"/{"provider"/g' custom_components/afvalwijzer/tests/test_data.py - name: Test module run: | set -o pipefail scripts/test-module --show-failures-only 2>&1 | tee $GITHUB_STEP_SUMMARY
What changed
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.