Push actions workflow (ekutner/home-connect-hass)
The Push actions workflow from ekutner/home-connect-hass, explained and optimized by Latchkey.
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 →What it does
This is the Push 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
name: Push actions
on:
push:
branches:
- master
- dev
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 \
testsThe same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Push actions on: push: branches: - master - dev 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
- Cancel superseded runs when a branch or PR gets a newer push.
- 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 3 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.