Skip to content
Latchkey

Linting workflow (dvd-dev/hilo)

The Linting workflow from dvd-dev/hilo, explained and optimized by Latchkey.

F

CI health: F - at risk

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: dvd-dev/hilo.github/workflows/tests.yamlLicense MITView source

What it does

This is the Linting workflow from the dvd-dev/hilo 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: Linting

on:
  push:
    branches:
      - main
      - dev
  pull_request:

env:
  DEFAULT_PYTHON: 3.13

jobs:
  pre-commit:
    runs-on: "ubuntu-latest"
    name: Pre-commit
    steps:
      - name: Check out the repository
        uses: actions/checkout@v7

      - name: Set up Python ${{ env.DEFAULT_PYTHON }}
        uses: actions/setup-python@v6.3.0
        with:
          python-version: ${{ env.DEFAULT_PYTHON }}

      - name: Install uv
        uses: astral-sh/setup-uv@v8.3.2

      - name: Install dependencies
        run: |
          uv sync --group test

      - name: Run pre-commit on all files
        env:
          SKIP: no-commit-to-branch
        run: |
          uv run pre-commit run --all-files --show-diff-on-failure --color=always

  hacs:
    runs-on: "ubuntu-latest"
    name: HACS
    steps:
      - name: Check out the repository
        uses: "actions/checkout@v7"

      - name: HACS validation
        uses: "hacs/action@main"
        with:
          category: "integration"
          ignore: brands

  hassfest:
    runs-on: "ubuntu-latest"
    name: Hassfest
    steps:
      - name: Check out the repository
        uses: "actions/checkout@v7"

      - name: Hassfest validation
        uses: "home-assistant/actions/hassfest@master"

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Linting
 
on:
  push:
    branches:
      - main
      - dev
  pull_request:
 
env:
  DEFAULT_PYTHON: 3.13
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  pre-commit:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Pre-commit
    steps:
      - name: Check out the repository
        uses: actions/checkout@v7
 
      - name: Set up Python ${{ env.DEFAULT_PYTHON }}
        uses: actions/setup-python@v6.3.0
        with:
          cache: 'pip'
          python-version: ${{ env.DEFAULT_PYTHON }}
 
      - name: Install uv
        uses: astral-sh/setup-uv@v8.3.2
 
      - name: Install dependencies
        run: |
          uv sync --group test
 
      - name: Run pre-commit on all files
        env:
          SKIP: no-commit-to-branch
        run: |
          uv run pre-commit run --all-files --show-diff-on-failure --color=always
 
  hacs:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: HACS
    steps:
      - name: Check out the repository
        uses: "actions/checkout@v7"
 
      - name: HACS validation
        uses: "hacs/action@main"
        with:
          category: "integration"
          ignore: brands
 
  hassfest:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Hassfest
    steps:
      - name: Check out the repository
        uses: "actions/checkout@v7"
 
      - name: Hassfest validation
        uses: "home-assistant/actions/hassfest@master"
 

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.

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