nox workflow (partcad/partcad)
The nox workflow from partcad/partcad, 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 nox workflow from the partcad/partcad repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
# Minimalistic workflow to build the VS Code extension
# TODO(clairbee): build the extension as part of the "build" and "deploy" workflows
name: nox
on:
workflow_dispatch:
push:
branches:
- main
- devel
pull_request:
branches:
- devel
jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup-all
- name: Install prerequisites
shell: bash
run: |
sudo apt-get -q update || exit 1
sudo apt-get -q install -y \
libxml2-dev libxslt-dev \
libtiff5-dev libjpeg-dev libopenjp2-7-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev \
python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev
- name: install dependencies
run: pip install --upgrade attrs
- working-directory: partcad-ide-vscode
run: python -m pip install nox
- working-directory: partcad-ide-vscode
run: nox --session setup
- working-directory: partcad-ide-vscode
run: nox --session build_package
# TODO(clairbee): run VSCode tests (that depend on the PartCAD Python module)
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
# Minimalistic workflow to build the VS Code extension # TODO(clairbee): build the extension as part of the "build" and "deploy" workflows name: nox on: workflow_dispatch: push: branches: - main - devel pull_request: branches: - devel concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 strategy: matrix: os: [ubuntu-24.04] python-version: ["3.12"] runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 - uses: ./.github/actions/setup-all - name: Install prerequisites shell: bash run: | sudo apt-get -q update || exit 1 sudo apt-get -q install -y \ libxml2-dev libxslt-dev \ libtiff5-dev libjpeg-dev libopenjp2-7-dev zlib1g-dev \ libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev \ python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev - name: install dependencies run: pip install --upgrade attrs - working-directory: partcad-ide-vscode run: python -m pip install nox - working-directory: partcad-ide-vscode run: nox --session setup - working-directory: partcad-ide-vscode run: nox --session build_package # TODO(clairbee): run VSCode tests (that depend on the PartCAD Python module)
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 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.