Skip to content

About / Quickstart

Quickstart

This guide takes one repository from nothing to a green check run. Steps 1 to 4 run on your machine. Steps 5 and 6 connect the repository to hatchrun.

  • A GitHub repository you can push to.
  • A card on file for your organization. hatchrun CI jobs wait until there is one. See Billing.
  • A Linux machine on x86-64 or arm64 for the prebuilt CLI. On macOS or anything else, you need Rust to build it.
  • The GitHub CLI to download the release. You can also download the files from the release page by hand.
  1. Prebuilt binaries are for Linux on x86-64 and arm64 for now. Each release of hatchrun/hatchrun has hatchrun-VERSION-linux-amd64.tar.gz and hatchrun-VERSION-linux-arm64.tar.gz.

    Terminal window
    VERSION=$(gh release view --repo hatchrun/hatchrun --json tagName -q .tagName | sed 's/^v//')
    gh release download "v$VERSION" --repo hatchrun/hatchrun \
    --pattern "hatchrun-${VERSION}-linux-amd64.tar.gz" --pattern SHA256SUMS
    sha256sum --check --ignore-missing SHA256SUMS
    tar -xzf "hatchrun-${VERSION}-linux-amd64.tar.gz"
    sudo install -m 0755 "hatchrun-${VERSION}-linux-amd64/hatchrun" /usr/local/bin/hatchrun

    On arm64, write linux-arm64 in the file names. On macOS, build from source instead:

    Terminal window
    cargo install --locked --git https://github.com/hatchrun/hatchrun hatchrun-cli

    Cargo puts the hatchrun binary in ~/.cargo/bin. Check the install:

    Terminal window
    hatchrun --version

    You see hatchrun and the version number.

  2. In the root of the repository, create .hatchrun/config.yml:

    .hatchrun/config.yml
    jobs:
    test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v5
    - run: make test
    workflows:
    ci:
    on:
    push:
    branches: [main]
    pull_request: {}
    jobs:
    - test

    Replace make test with your own test command. The workflow ci runs the job test on every push to main and on every pull request.

    If the repository already has GitHub Actions workflows, convert them instead of writing the file:

    Terminal window
    hatchrun convert -o .hatchrun/config.yml

    Read Migrate from GitHub Actions before you trust the result.

  3. Terminal window
    hatchrun validate

    No output and exit code 0 mean the file is valid. Otherwise each line names a problem. Fix them and run it again. See Fix validate errors.

  4. Terminal window
    git add .hatchrun/config.yml
    git commit -m "ci: add hatchrun config"

    Do not push yet if the GitHub App is not installed. Nothing reads the file until it is.

  5. Sign in to app.hatchrun.io with GitHub and install the App on your organization. Add a card there too, or jobs wait. See Install the GitHub App.

  6. Push the commit to main, or open a pull request. A check run named test appears as queued, then in progress, then passes. If nothing appears, see My workflow did not run.