Test Deployment workflow (anuraghazra/github-readme-stats)
The Test Deployment workflow from anuraghazra/github-readme-stats, explained and optimized by Latchkey.
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Test Deployment workflow from the anuraghazra/github-readme-stats 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: Test Deployment
on:
# Temporarily disabled automatic triggers; manual-only for now.
workflow_dispatch:
# Original trigger (restore to re-enable):
# deployment_status:
permissions: read-all
jobs:
e2eTests:
# Temporarily disabled; set to the original condition to re-enable.
# if:
# github.repository == 'anuraghazra/github-readme-stats' &&
# github.event_name == 'deployment_status' &&
# github.event.deployment_status.state == 'success'
if: false
name: Perform e2e tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
env:
CI: true
- name: Run end-to-end tests.
run: npm run test:e2e
# env:
# VERCEL_PREVIEW_URL: ${{ github.event.deployment_status.target_url }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Test Deployment on: # Temporarily disabled automatic triggers; manual-only for now. workflow_dispatch: # Original trigger (restore to re-enable): # deployment_status: permissions: read-all jobs: e2eTests: timeout-minutes: 30 # Temporarily disabled; set to the original condition to re-enable. # if: # github.repository == 'anuraghazra/github-readme-stats' && # github.event_name == 'deployment_status' && # github.event.deployment_status.state == 'success' if: false name: Perform e2e tests runs-on: latchkey-small strategy: matrix: node-version: [22.x] steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Setup Node uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: ${{ matrix.node-version }} cache: npm - name: Install dependencies run: npm ci env: CI: true - name: Run end-to-end tests. run: npm run test:e2e # env: # VERCEL_PREVIEW_URL: ${{ github.event.deployment_status.target_url }}
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. - 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
- End-to-end and browser tests
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.