CI (engine.io-client) workflow (socketio/socket.io)
The CI (engine.io-client) workflow from socketio/socket.io, explained and optimized by Latchkey.
CI health: A - excellent
Point runs-on at Latchkey and get run de-duplication, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the CI (engine.io-client) workflow from the socketio/socket.io 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 (engine.io-client)
on:
push:
branches:
- '**'
paths:
- 'packages/engine.io/**'
- 'packages/engine.io-client/**'
- 'packages/engine.io-parser/**'
- 'packages/socket.io-component-emitter/**'
- '.github/workflows/ci-engine.io-client.yml'
pull_request:
paths:
- 'packages/engine.io/**'
- 'packages/engine.io-client/**'
- 'packages/engine.io-parser/**'
- 'packages/socket.io-component-emitter/**'
- '.github/workflows/ci-engine.io-client.yml'
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Compile dependencies
run: |
npm run compile \
--workspace=engine.io-parser
- name: Compile package
run: npm run compile --workspace=engine.io-client
- name: Compile dev dependencies
run: |
npm run compile \
--workspace=engine.io
- name: Run tests
run: npm test --workspace=engine.io-client
- name: Run tests with fetch instead of XHR
run: npm run test:node-fetch --workspace=engine.io-client
- name: Run tests with Node.js native WebSocket
run: npm run test:node-builtin-ws --workspace=engine.io-client
# TODO: migrate tests from zuul to WebdriverIO
# - name: Run tests in browser
# if: github.event_name == 'push'
# run: npm test --workspace=engine.io-client
# env:
# BROWSERS: 1
# SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
# SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: CI (engine.io-client) on: push: branches: - '**' paths: - 'packages/engine.io/**' - 'packages/engine.io-client/**' - 'packages/engine.io-parser/**' - 'packages/socket.io-component-emitter/**' - '.github/workflows/ci-engine.io-client.yml' pull_request: paths: - 'packages/engine.io/**' - 'packages/engine.io-client/**' - 'packages/engine.io-parser/**' - 'packages/socket.io-component-emitter/**' - '.github/workflows/ci-engine.io-client.yml' permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: runs-on: latchkey-small timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v6 - name: Use Node.js 24 uses: actions/setup-node@v6 with: node-version: 24 cache: npm - name: Install dependencies run: npm ci - name: Compile dependencies run: | npm run compile \ --workspace=engine.io-parser - name: Compile package run: npm run compile --workspace=engine.io-client - name: Compile dev dependencies run: | npm run compile \ --workspace=engine.io - name: Run tests run: npm test --workspace=engine.io-client - name: Run tests with fetch instead of XHR run: npm run test:node-fetch --workspace=engine.io-client - name: Run tests with Node.js native WebSocket run: npm run test:node-builtin-ws --workspace=engine.io-client # TODO: migrate tests from zuul to WebdriverIO # - name: Run tests in browser # if: github.event_name == 'push' # run: npm test --workspace=engine.io-client # env: # BROWSERS: 1 # SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} # SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
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.
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.