Skip to content
Latchkey

build workflow (sqlc-dev/sqlc)

The build workflow from sqlc-dev/sqlc, explained and optimized by Latchkey.

A

CI health: A - excellent

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: sqlc-dev/sqlc.github/workflows/build.ymlLicense MITView source

What it does

This is the build workflow from the sqlc-dev/sqlc 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: build
on:
  workflow_dispatch:
jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-24.04, macos-14, windows-2022]
    name: build ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v7
    - uses: actions/setup-go@v6
      with:
        go-version: '1.26.4'
    - name: install ./...
      run: go build ./...
      env:
        CGO_ENABLED: "0"

The same workflow, on Latchkey

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

name: build
on:
  workflow_dispatch:
jobs:
  build:
    timeout-minutes: 30
    strategy:
      matrix:
        os: [ubuntu-24.04, macos-14, windows-2022]
    name: build ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v7
    - uses: actions/setup-go@v6
      with:
        go-version: '1.26.4'
    - name: install ./...
      run: go build ./...
      env:
        CGO_ENABLED: "0"
 

What changed

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