Skip to content
Latchkey

CI actions workflow (marcolivierarsenault/moonraker-home-assistant)

The CI actions workflow from marcolivierarsenault/moonraker-home-assistant, 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: marcolivierarsenault/moonraker-home-assistant.github/workflows/ci.ymlLicense MITView source

What it does

This is the CI actions workflow from the marcolivierarsenault/moonraker-home-assistant 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: CI actions

on:
  pull_request:
  push:
    branches:
      - main

permissions:
  contents: read

jobs:
  validate:
    runs-on: "ubuntu-latest"
    name: Validate
    steps:
      - uses: "actions/checkout@v6"

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

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

  ruff:
    name: "Ruff"
    runs-on: "ubuntu-latest"
    steps:
      - name: "Checkout the repository"
        uses: "actions/checkout@v6"

      - name: "Set up Python"
        uses: actions/setup-python@v6
        with:
          python-version: "3.13"
          cache: "pip"

      - name: "Install requirements"
        run: python3 -m pip install -r requirements.txt

      - name: "Run"
        run: python3 -m ruff check .

  tests:
    runs-on: "ubuntu-latest"
    name: Run tests
    permissions:
      contents: write
    steps:
      - name: Check out code from GitHub
        uses: "actions/checkout@v6"
      - name: Setup Python
        uses: "actions/setup-python@v6"
        with:
          python-version: "3.13"
      - name: Install requirements
        run: python3 -m pip install -r requirements.txt
      - name: Run tests
        run: |
          pytest . --cov=custom_components.moonraker --cov-report=xml
      - name: Upload coverage reports to Codecov with GitHub Action
        uses: codecov/codecov-action@v6
        with:
          token: ${{ secrets.CODECOV_TOKEN }}

The same workflow, on Latchkey

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

name: CI actions
 
on:
  pull_request:
  push:
    branches:
      - main
 
permissions:
  contents: read
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  validate:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Validate
    steps:
      - uses: "actions/checkout@v6"
 
      - name: HACS validation
        uses: "hacs/action@main"
        with:
          category: "integration"
          ignore: brands
 
      - name: Hassfest validation
        uses: "home-assistant/actions/hassfest@master"
 
  ruff:
    timeout-minutes: 30
    name: "Ruff"
    runs-on: "ubuntu-latest"
    steps:
      - name: "Checkout the repository"
        uses: "actions/checkout@v6"
 
      - name: "Set up Python"
        uses: actions/setup-python@v6
        with:
          python-version: "3.13"
          cache: "pip"
 
      - name: "Install requirements"
        run: python3 -m pip install -r requirements.txt
 
      - name: "Run"
        run: python3 -m ruff check .
 
  tests:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Run tests
    permissions:
      contents: write
    steps:
      - name: Check out code from GitHub
        uses: "actions/checkout@v6"
      - name: Setup Python
        uses: "actions/setup-python@v6"
        with:
          python-version: "3.13"
      - name: Install requirements
        run: python3 -m pip install -r requirements.txt
      - name: Run tests
        run: |
          pytest . --cov=custom_components.moonraker --cov-report=xml
      - name: Upload coverage reports to Codecov with GitHub Action
        uses: codecov/codecov-action@v6
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
 

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