nektos / act

Run your GitHub Actions locally 🚀
https://nektosact.com
MIT License
55.25k stars 1.38k forks source link

Enhancement: Use act as a self-hosted runner for github actions #706

Open ChristopherHX opened 3 years ago

ChristopherHX commented 3 years ago

Some people want to have more platform support for self-hosted runners than dotnet provides. What about reusing the runner of act to create a self-hosted runner written in go?

I have written a proof of concept prototype which (partially) implements github's / microsoft's proprietary azure pipelines protocol and executes the job via act.

Does this fit into the goals of act? I guess this breaks

"Think globally, act locally"

from the ReadMe.

I thinks this improves compatibility for workflows tested against act, because less lines of the workflow are interpreted by github.

My problems using act as library are:

What works

Sample Test Run of my prototype: Webaufnahme_25-5-2021_22519_github com

My prototype currently doesn't have a cli parser and needs small code changes to be registered against github or my own actions server, Implemented now

igagis commented 3 years ago

I'm trying @ChristopherHX 's runner at the moment, it looks very promising for my needs.

catthehacker commented 3 years ago

I don't see it happening in a near future. I assigned us to this but it's not something that is planned to be implemented in act. It would be nice to see if there is any demand for it but act is mostly useful to eliminate the need to trigger GitHub Actions.

I've also explained here why it's not recommended for now to do such things. The ultimate priority for now is to match full compliance with GitHub Actions workflow behaviour, since we still have a lot of issues with that (e.g.: env: not properly parsed).

igagis commented 3 years ago

It would be nice to see if there is any demand for it but act is mostly useful to eliminate the need to trigger GitHub Actions.

I'm currently using @ChristopherHX 's runner based on act due to some bug in official github runner, and it doesn't seem like they will fix it anytime soon, see https://github.com/actions/runner/issues/1168.

catthehacker commented 3 years ago

By demand, I meant volume of it, and quite a big one if we want to consider implementing such big change at all.

ChristopherHX commented 3 years ago

Well I have implemented it already, so it will keep a different Project for now. There is no need to change the existing code of act, other than make it to match github actions more closely. For example the timeout-minutes is an interger, but it is an expression on github actions. The protocol could live in an external github repo, then only some step translations needs to be intergrated into act.

catthehacker commented 3 years ago

There is no need to change the existing code of act, other than make it to match github actions more closely

image

StevenACoffman commented 2 years ago

@ChristopherHX I was wondering how much more remains to be upstreamed from your fork to make nektos/act match github actions more closely? I use both your fork and nektos/act and would love to have the diff be as small as possible

The protocol could live in an external github repo, then only some step translations needs to be integrated into act.

@catthehacker would you be supportive of this incorporating the step translations into nektos/act (with a flag or something to disable it by default)?

catthehacker commented 2 years ago

(with a flag or something to disable it by default)?

if it will be useful for act, then I don't see why it would be under a flag.

ChristopherHX commented 2 years ago

I was wondering how much more remains to be upstreamed from your fork

More or less this is still pending

match github actions more closely

This is more or less optional, I meant only quality / usablilty improvements.

Technically if only the docker executor is required, We could skip over to