act icon indicating copy to clipboard operation
act copied to clipboard

Support Windows

Open Michael-Tang-2009 opened this issue 3 years ago • 10 comments

Act version

V0.2.42

Feature description

I'm working with .NET Framework, but this act may not support it. So, I hope that this will be support Windows soon.

Michael-Tang-2009 avatar Feb 05 '23 00:02 Michael-Tang-2009

This feature is included in recent releases of nektos/act.

Warning add defaults.run.shell to your job, otherwise act tries to use bash instead of powershell.

./act -P windows-latest=-self-hosted -W test.yml

ChristopherHX avatar Feb 05 '23 12:02 ChristopherHX

First of all. I want to thank you for your helping. I may not find docs about it right now, really. Hummmmm, there is some problem with it, just like the picture ERROR_LOG .

I have two question here:

Does it runs on something like docker image? I used the command that you posted out in the last commented, but there meight something goes wrong. Or maybe I need to download all the action code which I reference in my workflow file and put it into folder "action" or something else?

Michael-Tang-2009 avatar Feb 05 '23 12:02 Michael-Tang-2009

Does it runs on something like docker image?

No, it runs actions directly on your windows system.

I used the command that you posted out in the last commented, but there meight something goes wrong

You have to install nodejs from https://nodejs.org/en/ for most actions to work. Otherwise you can only use composite actions and run scripts.

ChristopherHX avatar Feb 05 '23 12:02 ChristopherHX

Thanks for all the helpings, I will try it later to make sure that runs correctly and I'll close this. I want to advice that I meight cannot find anything about windows platform, so that I think it is important to add into README.md.

Michael-Tang-2009 avatar Feb 05 '23 12:02 Michael-Tang-2009

Hummmmm, I do not know how to deal with this: time="2023-02-05T21:01:20+08:00" level=warning msg="unable to get git repo: remote not found" time="2023-02-05T21:01:20+08:00" level=error msg="failed to obtain container engine info: error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/info": open //./pipe/docker_engine: The system cannot find the file specified."

Michael-Tang-2009 avatar Feb 05 '23 13:02 Michael-Tang-2009

I'm just ignoring that "failed to obtain container engine info" error.

This windows mode has known issues, which might be good to resolve before documenting it for everyone.

  • the docker connect error you posted
  • ~~the env context needs to be case insensitive on windows, but isn't right now.~~ Fixed (#1732)
  • ~~default shell on windows is wrong (fixes: https://github.com/ChristopherHX/act/commit/62e165f3c61710c1b51d929054a4614a54e23eb2, https://github.com/ChristopherHX/act/commit/092f283111124f0d2bf5f200223401423ed2ff63)~~ Fixed (#1942)
  • ~~cmd cannot be used as shell (https://github.com/ChristopherHX/act/commit/4ac9ff49831707bda263a369ae8aea50d262450a)~~ Fixed (#1941)
  • ~~hashfiles is broken (fixes: https://github.com/ChristopherHX/act/commit/aec5ff7a0240c136a637fd6558befc5e7553cf08, https://github.com/ChristopherHX/act/commit/dd3cfce42d4dc4e7efb708c6c0224e2f202b9469)~~ (Does't apply to HostEnvironment)
  • ...probably more known issues

ChristopherHX avatar Feb 05 '23 16:02 ChristopherHX

I'm also have the problem message like time="2023-02-06T09:08:36+08:00" level=warning msg="unable to get git repo: remote not found" But I already checked the config file where under .git folder.

Michael-Tang-2009 avatar Feb 06 '23 01:02 Michael-Tang-2009

Is there a way to run test actions on the Windows platform from WSL2 (running under Windows)?

dalleyg avatar Feb 23 '24 22:02 dalleyg

Job cancelling doesn't work on Windows?

wangito33 avatar Apr 03 '24 12:04 wangito33

Any way to run a windows image in a docker? Codespaces don't support Windows either and I can't think of any lightweight option to run a build on Windows, other than a full VM.

nukeop avatar Jun 15 '24 00:06 nukeop