gha-runner

Crates.iogha-runner
lib.rsgha-runner
version0.2.0
sourcesrc
created_at2021-11-24 02:22:47.176751
updated_at2024-05-06 20:33:23.167007
descriptionRun Github Actions workflows locally or on a custom backend
homepagehttps://pernos.co
repositoryhttps://github.com/Pernosco/gha-runner
max_upload_size
id486651
size147,845
Kyle Huey (khuey)

documentation

https://docs.rs/gha-runner

README

gha-runner runs Github Actions workflows. You can run workflows locally, or extend gha-runner with custom backends to run workflows elsewhere (e.g. Pernosco uses gha-runner to run Github Actions workflows in ECS). You can also customize the execution of workflows, e.g. wrapping the execution of workflow steps with various tools.

Getting Started

git clone https://github.com/Pernosco/gha-runner
cd gha-runner
cargo build --examples
target/debug/examples/gha_local --image-path ghcr.io/catthehacker/ubuntu:act Pernosco github-actions-test 6475d0f048a72996e3bd559cdd3763f53fe3d072 .github/workflows/build.yml "Build+test (stable, ubuntu-18.04)"

The first time you run this it will download the 1GB docker image ghcr.io/catthehacker/ubuntu:act-18.04; this may take a while on a slow connection.

Status

Very simple workflows are supported. Many Github Actions features are not yet supported, e.g.

  • Action steps that use their own containers
  • Much of the expression syntax
  • Pre/post actions
  • Workflows that run their own docker commands

PRs welcome!

Instrumenting workflows

To demonstrate this capability, the gha_local example has an --strace option that runs the action steps under strace.

target/debug/examples/gha_local --strace /tmp/strace.out --image-path ghcr.io/catthehacker/ubuntu:js Pernosco github-actions-test 6475d0f048a72996e3bd559cdd3763f53fe3d072 .github/workflows/build.yml "Build+test (stable, ubuntu-18.04)"
Commit count: 19

cargo fmt