Skip to content
Latchkey

Build ncem Package workflow (theislab/ncem)

The Build ncem Package workflow from theislab/ncem, explained and optimized by Latchkey.

D

CI health: D - needs work

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: theislab/ncem.github/workflows/build_package.ymlLicense BSD-3-ClauseView source

What it does

This is the Build ncem Package workflow from the theislab/ncem repository, a real project running GitHub Actions. It is shown here with attribution under its BSD-3-Clause license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Build ncem Package

on: [push, pull_request]

jobs:
    build:
        runs-on: ${{ matrix.os }}
        if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
        strategy:
            matrix:
                os: [macos-latest, ubuntu-latest, windows-latest]
                python: [3.8]

        steps:
            - uses: actions/checkout@v2
              name: Check out source-code repository

            - name: Setup Python
              uses: actions/setup-python@v4.3.0
              with:
                  python-version: ${{ matrix.python }}

            - name: Install Poetry
              run: |
                  pip install poetry
                  poetry --version

            - name: Build package
              run: poetry build --ansi

            - name: Install required twine packaging dependencies
              run: pip install setuptools wheel twine

            - name: Check twine package
              run: twine check dist/*

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Build ncem Package
 
on: [push, pull_request]
 
concurrency:
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true
 
jobs:
    build:
        timeout-minutes: 30
        runs-on: ${{ matrix.os }}
        if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
        strategy:
            matrix:
                os: [macos-latest, ubuntu-latest, windows-latest]
                python: [3.8]
 
        steps:
            - uses: actions/checkout@v2
              name: Check out source-code repository
 
            - name: Setup Python
              uses: actions/setup-python@v4.3.0
              with:
                  cache: 'pip'
                  python-version: ${{ matrix.python }}
 
            - name: Install Poetry
              run: |
                  pip install poetry
                  poetry --version
 
            - name: Build package
              run: poetry build --ansi
 
            - name: Install required twine packaging dependencies
              run: pip install setuptools wheel twine
 
            - name: Check twine package
              run: twine check dist/*
 

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 1 job (3 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow