Integration workflow (pgrok/pgrok)
The Integration workflow from pgrok/pgrok, explained and optimized by Latchkey.
C
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 Integration workflow from the pgrok/pgrok 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: Integration
on:
push:
branches: [ main ]
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/integration.yml'
pull_request:
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/integration.yml'
env:
GOPROXY: "https://proxy.golang.org"
jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.6
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Check out code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: 1.26.x
- name: Install pnpm
uses: pnpm/action-setup@9fd676a19091d4595eefd76e4bd31c97133911f1 # v4.2.0
with:
version: 11
run_install: |
- cwd: pgrokd/web
- name: Run tests
run: |
go test ./integration-tests -v -long
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Integration on: push: branches: [ main ] paths: - '**.go' - 'go.mod' - '.github/workflows/integration.yml' pull_request: paths: - '**.go' - 'go.mod' - '.github/workflows/integration.yml' env: GOPROXY: "https://proxy.golang.org" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: timeout-minutes: 30 name: Test runs-on: latchkey-small services: postgres: image: postgres:9.6 env: POSTGRES_PASSWORD: postgres options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: - 5432:5432 steps: - name: Check out code uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Install Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: go-version: 1.26.x - name: Install pnpm uses: pnpm/action-setup@9fd676a19091d4595eefd76e4bd31c97133911f1 # v4.2.0 with: version: 11 run_install: | - cwd: pgrokd/web - name: Run tests run: | go test ./integration-tests -v -long
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 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.