Build workflow (yaqwsx/Pinion)
The Build workflow from yaqwsx/Pinion, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Build workflow from the yaqwsx/Pinion 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: Build
on:
push:
schedule:
# Refresh artifacts before the 14-day retention window expires.
- cron: "0 3 * * 0"
workflow_dispatch:
jobs:
build:
name: "Build pinion documentation"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
kicad: ["9", "10"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies and Pinion
run: |
set -e
sudo add-apt-repository --yes ppa:kicad/kicad-${{ matrix.kicad }}.0-releases
sudo apt-get -qq update
sudo apt-get -qq install --yes --no-install-recommends \
zip inkscape librsvg2-bin make git \
kicad kicad-footprints kicad-symbols kicad-packages3d \
python3 python3-pip \
npm
python3 -m pip install --break-system-packages mkdocs
python3 -m pip install --break-system-packages -e .
# Temporarily install upstream version of PcbDraw
python3 -m pip install --break-system-packages --force git+https://github.com/yaqwsx/PcbDraw@master
cd pinion-widget
npm install
cd ..
- name: Build pinion package
run: |
set -e
make package
- name: Upload pinion package artifact
uses: actions/upload-artifact@v4
with:
name: pinion-package-kicad${{ matrix.kicad }}
path: dist
retention-days: 14
- name: Upload pinion-widget package artifact
uses: actions/upload-artifact@v4
with:
name: pinion-widget-package-kicad${{ matrix.kicad }}
path: build/widget
retention-days: 14
- run: |
make web
- name: Deploy to GH Pages
if: github.ref == 'refs/heads/main' && matrix.kicad == '10'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: site
single-commit: true
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Build on: push: schedule: # Refresh artifacts before the 14-day retention window expires. - cron: "0 3 * * 0" workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 name: "Build pinion documentation" runs-on: latchkey-small strategy: fail-fast: false matrix: kicad: ["9", "10"] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install dependencies and Pinion run: | set -e sudo add-apt-repository --yes ppa:kicad/kicad-${{ matrix.kicad }}.0-releases sudo apt-get -qq update sudo apt-get -qq install --yes --no-install-recommends \ zip inkscape librsvg2-bin make git \ kicad kicad-footprints kicad-symbols kicad-packages3d \ python3 python3-pip \ npm python3 -m pip install --break-system-packages mkdocs python3 -m pip install --break-system-packages -e . # Temporarily install upstream version of PcbDraw python3 -m pip install --break-system-packages --force git+https://github.com/yaqwsx/PcbDraw@master cd pinion-widget npm install cd .. - name: Build pinion package run: | set -e make package - name: Upload pinion package artifact uses: actions/upload-artifact@v4 with: name: pinion-package-kicad${{ matrix.kicad }} path: dist retention-days: 14 - name: Upload pinion-widget package artifact uses: actions/upload-artifact@v4 with: name: pinion-widget-package-kicad${{ matrix.kicad }} path: build/widget retention-days: 14 - run: | make web - name: Deploy to GH Pages if: github.ref == 'refs/heads/main' && matrix.kicad == '10' uses: JamesIves/github-pages-deploy-action@v4 with: branch: gh-pages folder: site single-commit: true
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - 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.
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:
- Dependency installs
This workflow runs 1 job (2 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.