integration workflow (x-motemen/ghq)
The integration workflow from x-motemen/ghq, 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 →What it does
This is the integration workflow from the x-motemen/ghq 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:
- master
permissions:
contents: read
jobs:
test:
timeout-minutes: 20
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: setup go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
- name: install
run: |
make install
brew reinstall git || true
brew link --overwrite git
brew install git-svn mercurial fossil breezy darcs
brew upgrade git-svn mercurial fossil breezy darcs
- name: test
run: PATH=$HOME/bin:$PATH ./misc/author/integration_test.sh
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: integration on: push: branches: - master permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: timeout-minutes: 20 runs-on: macos-latest steps: - name: checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: setup go uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version-file: go.mod - name: install run: | make install brew reinstall git || true brew link --overwrite git brew install git-svn mercurial fossil breezy darcs brew upgrade git-svn mercurial fossil breezy darcs - name: test run: PATH=$HOME/bin:$PATH ./misc/author/integration_test.sh
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.