Skip to main content

Package Layout

Server Mode Data Flow

Local Mode Data Flow

MicroVM Lifecycle

Each CI job runs inside an ephemeral CloudHypervisor microVM. Independent jobs (no needs: dependency between them) run in parallel, each in its own VM. The number of concurrent VMs is auto-detected from host RAM or set via VM_MAX_PARALLEL.
The workspace is shared bidirectionally via virtiofs. The host clones the repo, and the VM sees it at /workspace. Networking uses a TAP device attached to a Linux bridge (br0) with NAT, giving VMs full internet access for downloading dependencies.

Expression Engine

The internal/expr/ package implements a full GitHub Actions expression evaluator:
  • Lexer tokenizes expression contents inside ${{ }}
  • Parser performs recursive descent producing an AST
  • Evaluator does tree-walking with GitHub Actions truthiness rules
  • Interpolation finds ${{ }} delimiters, evaluates, and splices results
Supports: context access (github.sha), operators (==, !=, &&, ||, !), functions (contains, startsWith, format, join, toJSON, fromJSON, success, failure, always, cancelled), index access (matrix['os']).

Runner Events

The runner communicates via a buffered Go channel of typed events: In server mode, the worker drains these events into the RunStore, which notifies SSE subscribers for the web dashboard and builds the log output for the GitHub Checks API.

GitHub Integration

Athanor uses two GitHub APIs: Checks API (requires GitHub App) creates a check run per workflow with full Markdown-formatted log output. Each job and step appears with its status and output in a code block. GitHub displays this in the check run details view. Commit Statuses (works with PAT) sets a single athanor status on the commit. Always set as a fallback. Authentication for the Checks API uses standard GitHub App JWT flow:
  1. Sign a JWT with the app’s RSA private key
  2. Exchange it for a short-lived installation token
  3. Use the token for API calls
  4. Cache and refresh automatically

Job Scheduling

Jobs are sorted using Kahn’s algorithm for topological ordering, producing levels of parallelizable jobs. Matrix jobs are expanded into virtual jobs before sorting.

Action Support

The internal/action/ package handles uses: steps:
  1. Resolve parses owner/repo@version, ./local/path, or docker://image
  2. Builtins provide a built-in shim for actions/checkout (git checkout)
  3. Cache clones action repos to ~/.cache/athanor/actions/
  4. Metadata parses action.yml for inputs, outputs, runs
  5. Composite executes composite action steps inline
  6. Node executes Node.js actions via node (if available)