Skip to content
Latchkey

Afvalwijzer: Validation And Formatting workflow (xirixiz/homeassistant-afvalwijzer)

The Afvalwijzer: Validation And Formatting workflow from xirixiz/homeassistant-afvalwijzer, explained and optimized by Latchkey.

C

CI health: C - fair

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: xirixiz/homeassistant-afvalwijzer.github/workflows/ci.ymlLicense MITView source

What it does

This is the Afvalwijzer: Validation And Formatting 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

workflow (.yml)
name: "Afvalwijzer: Validation And Formatting"

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

jobs:
  hassfest:
    runs-on: "ubuntu-latest"
    name: Hassfest validation
    steps:
      - uses: "actions/checkout@v7"
      - name: HACS Action
        uses: "hacs/action@main"
        with:
          category: "integration"
          ignore: "brands"
      - name: Hassfest validation
        uses: "home-assistant/actions/hassfest@master"

  style:
    runs-on: "ubuntu-latest"
    name: Check style formatting
    steps:
      - uses: "actions/checkout@v7"
      - uses: "actions/setup-python@v6"
        with:
          python-version: "3.x"
          cache: "pip"
      - run: python3 -m pip install --upgrade pip
      - run: python3 -m pip install ruff
      - run: ruff check --output-format github .

  tests:
    runs-on: "ubuntu-latest"
    name: Run tests
    steps:
      - uses: "actions/checkout@v7"
      - uses: "actions/setup-python@v6"
        with:
          python-version: "3.x"
          cache: "pip"
          cache-dependency-path: |
            requirements.txt
            requirements_test.txt
      - run: python3 -m pip install --upgrade pip
      - run: python3 -m pip install -r requirements.txt -r requirements_test.txt
      - run: scripts/coverage
      - uses: dorny/test-reporter@v3.0.0
        with:
          name: Test Results
          path: pytest.xml
          reporter: java-junit

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: "Afvalwijzer: Validation And Formatting"
 
on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  hassfest:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Hassfest validation
    steps:
      - uses: "actions/checkout@v7"
      - name: HACS Action
        uses: "hacs/action@main"
        with:
          category: "integration"
          ignore: "brands"
      - name: Hassfest validation
        uses: "home-assistant/actions/hassfest@master"
 
  style:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Check style formatting
    steps:
      - uses: "actions/checkout@v7"
      - uses: "actions/setup-python@v6"
        with:
          python-version: "3.x"
          cache: "pip"
      - run: python3 -m pip install --upgrade pip
      - run: python3 -m pip install ruff
      - run: ruff check --output-format github .
 
  tests:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Run tests
    steps:
      - uses: "actions/checkout@v7"
      - uses: "actions/setup-python@v6"
        with:
          python-version: "3.x"
          cache: "pip"
          cache-dependency-path: |
            requirements.txt
            requirements_test.txt
      - run: python3 -m pip install --upgrade pip
      - run: python3 -m pip install -r requirements.txt -r requirements_test.txt
      - run: scripts/coverage
      - uses: dorny/test-reporter@v3.0.0
        with:
          name: Test Results
          path: pytest.xml
          reporter: java-junit
 

What changed

1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

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:

This workflow runs 3 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow