Files
devops-guide/docs/task-automation.md
Jev Kuznetsov 846eca59d2 add knowledge
2026-04-23 12:06:00 +02:00

1.3 KiB

Task Automation

One entry point for all dev workflows — so you don't have to remember long commands or teach them to teammates.

Tools by Language

Language Recommended Alternatives
Python invoke make, tox
JavaScript/TS npm scripts, turbo nx
Go make, task mage
C++ cmake, make ninja

Python — invoke

Define tasks in tasks.py:

from invoke import task

@task
def lint(c):
    c.run("ruff check . && mypy .")

@task
def test(c):
    c.run("pytest")

@task
def ci(c, lint=True, test=True):
    if lint:
        lint(c)
    if test:
        test(c)
invoke lint
invoke test
invoke ci

Make (universal fallback)

Works everywhere, no install needed.

.PHONY: lint test ci

lint:
	ruff check . && mypy .

test:
	pytest

ci: lint test
make ci

JavaScript — npm scripts

{
  "scripts": {
    "lint": "biome check .",
    "test": "vitest run",
    "ci": "npm run lint && npm run test"
  }
}
npm run ci

Tips

  • Keep task names consistent across projects (lint, test, ci, build)
  • Tasks should call your other tools — they're orchestration, not implementation
  • make is the lowest common denominator; use it when portability matters