ci workflow (connectrpc/connect-go)
The ci workflow from connectrpc/connect-go, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the ci workflow from the connectrpc/connect-go 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
name: ci
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
schedule:
- cron: '15 22 * * *'
workflow_dispatch: {} # support manual runs
permissions:
contents: read
jobs:
ci:
name: ci (go:${{ matrix.go-version.name }})
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- name: latest
version: 1.26.x
- name: previous
version: 1.25.x
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version.version }}
- name: Unit Test
run: make shorttest
- name: Lint
# Often, lint & gofmt guidelines depend on the Go version. To prevent
# conflicting guidance, run only on the most recent supported version.
# For the same reason, only check generated code on the most recent
# supported version.
if: matrix.go-version.name == 'latest'
run: make checkgenerate && make lint
conformance:
name: conformance (go:${{ matrix.go-version.name }})
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- name: latest
version: 1.26.x
- name: previous
version: 1.25.x
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version.version }}
- name: Run Conformance Tests
run: make runconformance
slowtest:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@v6
with:
# only the latest
go-version: 1.26.x
- name: Run Slow Tests
run: make slowtest
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: ci on: push: branches: [main] tags: ['v*'] pull_request: branches: [main] schedule: - cron: '15 22 * * *' workflow_dispatch: {} # support manual runs permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: ci: timeout-minutes: 30 name: ci (go:${{ matrix.go-version.name }}) runs-on: latchkey-small strategy: matrix: go-version: - name: latest version: 1.26.x - name: previous version: 1.25.x steps: - name: Checkout Code uses: actions/checkout@v7 with: fetch-depth: 1 - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version.version }} - name: Unit Test run: make shorttest - name: Lint # Often, lint & gofmt guidelines depend on the Go version. To prevent # conflicting guidance, run only on the most recent supported version. # For the same reason, only check generated code on the most recent # supported version. if: matrix.go-version.name == 'latest' run: make checkgenerate && make lint conformance: timeout-minutes: 30 name: conformance (go:${{ matrix.go-version.name }}) runs-on: latchkey-small strategy: matrix: go-version: - name: latest version: 1.26.x - name: previous version: 1.25.x steps: - name: Checkout Code uses: actions/checkout@v7 with: fetch-depth: 1 - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version.version }} - name: Run Conformance Tests run: make runconformance slowtest: timeout-minutes: 30 runs-on: latchkey-small steps: - name: Checkout Code uses: actions/checkout@v7 with: fetch-depth: 1 - name: Install Go uses: actions/setup-go@v6 with: # only the latest go-version: 1.26.x - name: Run Slow Tests run: make slowtest
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.
This workflow runs 3 jobs (5 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.