Skip to content
Latchkey

Pull actions workflow (ekutner/home-connect-hass)

The Pull actions workflow from ekutner/home-connect-hass, 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: ekutner/home-connect-hass.github/workflows/pull.ymlLicense MITView source

What it does

This is the Pull actions workflow from the ekutner/home-connect-hass 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: Pull actions

on:
  pull_request:

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

        - name: HACS validation
          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@v2"
        - uses: "actions/setup-python@v1"
          with:
            python-version: "3.x"
        - run: python3 -m pip install black
        - run: black .

  tests:
    runs-on: "ubuntu-latest"
    name: Run tests
    steps:
      - name: Check out code from GitHub
        uses: "actions/checkout@v2"
      - name: Setup Python
        uses: "actions/setup-python@v1"
        with:
          python-version: "3.8"
      - name: Install requirements
        run: python3 -m pip install -r requirements_test.txt
      - name: Run tests
        run: |
          pytest \
            -qq \
            --timeout=9 \
            --durations=10 \
            -n auto \
            --cov custom_components.integration_blueprint \
            -o console_output_style=count \
            -p no:sugar \
            tests

The same workflow, on Latchkey

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

name: Pull actions
 
on:
  pull_request:
 
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@v2"
 
        - name: HACS validation
          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@v2"
        - uses: "actions/setup-python@v1"
          with:
            python-version: "3.x"
        - run: python3 -m pip install black
        - run: black .
 
  tests:
    timeout-minutes: 30
    runs-on: "ubuntu-latest"
    name: Run tests
    steps:
      - name: Check out code from GitHub
        uses: "actions/checkout@v2"
      - name: Setup Python
        uses: "actions/setup-python@v1"
        with:
          python-version: "3.8"
      - name: Install requirements
        run: python3 -m pip install -r requirements_test.txt
      - name: Run tests
        run: |
          pytest \
            -qq \
            --timeout=9 \
            --durations=10 \
            -n auto \
            --cov custom_components.integration_blueprint \
            -o console_output_style=count \
            -p no:sugar \
            tests
 

What changed

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.