Skip to content
Latchkey

CI workflow (nkanaev/yarr)

The CI workflow from nkanaev/yarr, explained and optimized by Latchkey.

C

CI health: C - fair

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: nkanaev/yarr.github/workflows/ci.ymlLicense MITView source

What it does

This is the CI workflow from the nkanaev/yarr 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: CI
on:
  push:
  workflow_dispatch:

jobs:
  test:
    uses: ./.github/workflows/test.yml

  build-docker:
    needs: test
    if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
    uses: ./.github/workflows/build-docker.yml
    secrets: inherit

  build-releases:
    needs: test
    if: startsWith(github.ref, 'refs/tags/v')
    uses: ./.github/workflows/build-releases.yml
    secrets: inherit

The same workflow, on Latchkey

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

name: CI
on:
  push:
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  test:
    timeout-minutes: 30
    uses: ./.github/workflows/test.yml
 
  build-docker:
    timeout-minutes: 30
    needs: test
    if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
    uses: ./.github/workflows/build-docker.yml
    secrets: inherit
 
  build-releases:
    timeout-minutes: 30
    needs: test
    if: startsWith(github.ref, 'refs/tags/v')
    uses: ./.github/workflows/build-releases.yml
    secrets: inherit
 

What changed

This workflow runs 3 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.