integration_tests workflow (open-duelyst/duelyst)
The integration_tests workflow from open-duelyst/duelyst, explained and optimized by Latchkey.
C
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the integration_tests workflow from the open-duelyst/duelyst repository, a real project running GitHub Actions. It is shown here with attribution under its CC0-1.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
workflow (.yml)
name: integration_tests
on:
push:
branches:
- main
pull_request:
paths:
- app/**
- config/**
- gulp/**
- gulpfile.babel.js
- package.json
- server/**
- test/**
- worker/**
- yarn.lock
jobs:
integration_tests:
runs-on: ubuntu-latest
container: node:24-bookworm-slim
services:
redis:
image: redis:6
db:
image: postgres:13
env:
POSTGRES_USER: duelyst
POSTGRES_PASSWORD: duelyst
POSTGRES_DB: duelyst
steps:
- name: check out code
uses: actions/checkout@v3
# Caching node_modules saves 50s on builds which don't modify dependencies.
# Compared to yarn caching, it saves an additional 27 seconds.
- name: cache node_modules
uses: actions/cache@v3
with:
path: /home/runner/work/duelyst/duelyst/node_modules
key: node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node-modules-
- name: enable corepack
run: corepack enable
- name: install node dependencies
run: yarn workspaces focus
- name: run database migrations
run: yarn migrate:latest
env:
NODE_ENV: development
POSTGRES_CONNECTION: "pg://duelyst:duelyst@db/duelyst"
- name: run integration tests
run: yarn test:integration:misc
env:
REDIS_HOST: redis
POSTGRES_CONNECTION: "pg://duelyst:duelyst@db/duelyst"
# TODO: Create a Firebase Realtime Database for CI.
FIREBASE_URL: "https://test-url.firebaseio.com/"
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: integration_tests on: push: branches: - main pull_request: paths: - app/** - config/** - gulp/** - gulpfile.babel.js - package.json - server/** - test/** - worker/** - yarn.lock concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: integration_tests: timeout-minutes: 30 runs-on: latchkey-small container: node:24-bookworm-slim services: redis: image: redis:6 db: image: postgres:13 env: POSTGRES_USER: duelyst POSTGRES_PASSWORD: duelyst POSTGRES_DB: duelyst steps: - name: check out code uses: actions/checkout@v3 # Caching node_modules saves 50s on builds which don't modify dependencies. # Compared to yarn caching, it saves an additional 27 seconds. - name: cache node_modules uses: actions/cache@v3 with: path: /home/runner/work/duelyst/duelyst/node_modules key: node-modules-${{ hashFiles('**/yarn.lock') }} restore-keys: | node-modules- - name: enable corepack run: corepack enable - name: install node dependencies run: yarn workspaces focus - name: run database migrations run: yarn migrate:latest env: NODE_ENV: development POSTGRES_CONNECTION: "pg://duelyst:duelyst@db/duelyst" - name: run integration tests run: yarn test:integration:misc env: REDIS_HOST: redis POSTGRES_CONNECTION: "pg://duelyst:duelyst@db/duelyst" # TODO: Create a Firebase Realtime Database for CI. FIREBASE_URL: "https://test-url.firebaseio.com/"
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.
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.