CI workflow (ganeshrvel/openmtp)
The CI workflow from ganeshrvel/openmtp, explained and optimized by Latchkey.
CI health: D - needs work
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 CI workflow from the ganeshrvel/openmtp 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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: macOS-11.00
steps:
- name: Setup build environment
uses: actions/setup-node@v1
with:
node-version: '16.x'
- run: npm install -g cross-env create-dmg
- name: Cloning Git repository
uses: actions/checkout@v1
- name: Attempt to build OpenMTP
run: |
yarn
yarn build
- name: Attempt to generate unsigned macOS app
run: |
export CSC_IDENTITY_AUTO_DISCOVERY=false
yarn package-mac-without-notarize 2>&1 || true
- name: Check if macOS app was generated
run: test -e dist/mac/OpenMTP.app
- name: Attempt to create disk image for generated macOS app
run: |
mkdir dist/dmg
create-dmg dist/mac/OpenMTP.app dist/dmg 2>&1 || true
shasum dist/dmg/* >> dist/dmg/CHECKSUM_SHA256.txt
- name: Upload disk image and checksum as artifact
uses: actions/upload-artifact@v1.0.0
with:
name: 'Disk Image'
path: dist/dmg/
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: CI on: push: branches: [ master ] pull_request: branches: [ master ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 runs-on: macOS-11.00 steps: - name: Setup build environment uses: actions/setup-node@v1 with: cache: 'npm' node-version: '16.x' - run: npm install -g cross-env create-dmg - name: Cloning Git repository uses: actions/checkout@v1 - name: Attempt to build OpenMTP run: | yarn yarn build - name: Attempt to generate unsigned macOS app run: | export CSC_IDENTITY_AUTO_DISCOVERY=false yarn package-mac-without-notarize 2>&1 || true - name: Check if macOS app was generated run: test -e dist/mac/OpenMTP.app - name: Attempt to create disk image for generated macOS app run: | mkdir dist/dmg create-dmg dist/mac/OpenMTP.app dist/dmg 2>&1 || true shasum dist/dmg/* >> dist/dmg/CHECKSUM_SHA256.txt - name: Upload disk image and checksum as artifact uses: actions/upload-artifact@v1.0.0 with: name: 'Disk Image' path: dist/dmg/
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.