Runs from a computer

Run a workflow's jobs on your own machines from your computer or a coding agent, with the working tree as it is and nothing pushed.

Run a workflow’s jobs on your SuperCI machines without pushing. You, or a coding agent, see whether CI would pass before anything leaves your computer.

superci runs create --workflow=.github/workflows/ci.yml
superci runs create --workflow=.github/workflows/ci.yml --job=test   # that job and those it needs

The command waits for the run and prints every line of its jobs, step by step, as GitHub shows them. It fails when the run does. (GitHub’s runner drops lines it cannot send as fast as a job prints them; what it dropped is printed from each step’s whole log when the step ends.) It ends with each step’s result and time, the machine and what it cost.

superci runs create --workflow=.github/workflows/ci.yml --quiet    # each step's result, and the end of one that failed
superci runs create --workflow=.github/workflows/ci.yml --detach   # its id, and back at once
superci runs wait ID                                               # follows it to its end

--quiet is for a coding agent, whose every line read costs.

What goes along

The working tree as it is on your computer: what git tracks, and the new files it does not ignore. An ignored .env stays behind. Nothing is pushed.

It goes through your control plane, so there is no new resource or permission in your cloud. It is kept there only until the run’s jobs have fetched it. Where your control plane has its bucket (AWS), the tree goes there, and after that only what changed since the folder’s last run is sent: a few KB for an agent that runs the tests after each edit.

How it runs

As GitHub runs it. GitHub’s own runner runs the steps: actions, service containers, expressions, step outputs.

  • Each combination of a matrix is a job of its own, on the machine its runs-on says.
  • A job starts once the jobs it needs have ended, and runs if its if holds (by default, if they all succeeded). It knows their results and outputs.
  • A matrix made by an expression (${{ fromJSON(needs.setup.outputs.matrix) }}) is read once the jobs it needs have ended.
  • A job that calls a workflow of the repository (uses: ./.github/workflows/build.yml) runs its jobs, with the inputs and secrets it gives them, and gets their outputs.
  • A job’s timeout-minutes and continue-on-error, steps side by side (background, wait, parallel), and YAML anchors work as on GitHub.
  • When AWS takes back a job’s spot machine, the job starts again at once, off spot machines.
  • Jobs use the cache as CI’s do: they read their branch’s and the default branch’s caches, and write a scope of their own, so a run from a computer never changes what CI finds.
  • The cache is its repository’s, as its jobs on your SuperCI machines saved it (what GitHub’s own hosted runners saved stays at GitHub). A checkout whose origin is not on GitHub, or a repository GitHub’s App is not installed on, has a cache of its own, and the run says so: --repo=OWNER/NAME names the GitHub repository it is a copy of.
  • upload-artifact in one job and download-artifact in the next work as on GitHub. Artifacts are kept for a day.

Getting artifacts back

What its jobs kept with upload-artifact can be fetched to your computer:

superci artifacts list --run=ID                 # each artifact's name and size
superci artifacts retrieve coverage --run=ID    # unpacked into ./coverage, as download-artifact would
superci artifacts retrieve coverage --run=ID --out=build/coverage

The run’s id is printed when it starts, and is in superci runs list. Its page in the dashboard lists them too, each a download. A run of GitHub’s keeps its artifacts at GitHub: gh run download fetches those.

What GitHub would give it

Keep its secrets in your CI, as a repository keeps them at GitHub. In a terminal the value is asked for and typed hidden; a script or a coding agent gives it on stdin or by a variable’s name. It is never in the command:

superci secrets create NPM_TOKEN               # asks for it, typed hidden
printf %s "$NPM_TOKEN" | superci secrets create NPM_TOKEN
superci secrets create DEPLOY_KEY --repo=acmeci/api --environment=production --value-env=DEPLOY_KEY
superci secrets list
  • A run gets the secrets its workflows name (${{ secrets.NPM_TOKEN }}) and nothing else. One it names that is not kept is empty, as on GitHub, and superci runs create says which before its jobs start.
  • --repo, --branch, --workflow and --environment narrow where a secret may be used (GitHub’s patterns: release/*). Under one name a job gets the narrowest: an environment’s, then a repository’s, a workflow’s, a branch’s.
  • They are written with your sign-in into your control plane’s own cloud and never read back out: list says names, where each may be used, when it was set, and its last run and who started it. Settings → Secrets does the same.
  • Jobs GitHub sends keep getting GitHub’s own secrets.

Or give a value with the run, which wins over a kept one:

superci runs create --workflow=.github/workflows/ci.yml \
  --secret=DATABASE_URL=postgres://… --var=REGION=eu \
  --event=pull_request
  • A secret is hidden in the job’s lines as GitHub hides secrets, and not kept once the job has ended.
  • There is no GITHUB_TOKEN and no OIDC.

The event

A run starts as a push, unless --event says otherwise. Its jobs see the payload GitHub would send (github.event), made from the working tree: the branch, the commit, a pull request’s head and base. A job’s if that reads it works as on GitHub.

superci runs create --workflow=.github/workflows/ci.yml --event=pull_request --label=e2e --label=slow
superci runs create --workflow=.github/workflows/release.yml --event=workflow_dispatch --input=channel=beta
superci runs create --workflow=.github/workflows/ci.yml --event=pull_request --event-payload=event.json
  • --label=NAME, as often as needed: the pull request’s labels, as if just added (its action labeled), for jobs such as if: contains(github.event.pull_request.labels.*.name, 'e2e').
  • --input=NAME=VALUE: a manual start’s inputs. The others take their defaults, typed as the workflow says; a required one left out, or a value its options do not have, is refused before anything is sent.
  • --event-payload=FILE: JSON put over the payload, for any field the others do not set.

Following it

Its jobs are listed with the others (superci jobs list, Runs), with their machines and their cost. A run from a computer has no page at GitHub, so its page in the dashboard shows how each job stands and its log.

A run key for coding agents

A coding agent on your own computer can use SuperCI’s sign-ins as they are. For one elsewhere, or one you want to keep from changing anything, give it a run key:

superci keys create agent --runs
SUPERCI_PLANE=https://… SUPERCI_KEY=superci_… superci runs create --workflow=.github/workflows/ci.yml

The key reads, starts runs from a computer (with the secrets your CI keeps for them) and fetches their artifacts, and changes nothing else. It has no limits of its own: its jobs keep to your control plane’s, as every job does, the largest machine and what may be spent in a month and a day (superci limits update --max-cpu=64 --daily-usd=50).

Not yet

A call of a workflow in another repository, a call inside a called workflow, and a call with a matrix. actions/checkout puts the working tree in place as one commit; another repository is not checked out.