box-project / box

📦🚀 Fast, zero config application bundler with PHARs.
https://box-project.github.io/box
MIT License
1.13k stars 100 forks source link

Add function-ability testing for Windows (Travis CI or GitHub Actions) #459

Closed KEINOS closed 2 years ago

KEINOS commented 4 years ago

Feature Request

TL; DR

Add some kind of CI workflow to test the archived phar function-ability on Windows over virtual env. GitHub Actions may be?

TS; DR

Since I'm a use-to-be-windows7 user and shifted to Docker-based development on Mac to run my scripts on a container for my Windows users, I have no Windows environment.

Though, I always wanted to be certain if my Phar file works on the Windows environment locally.

Because having a local Windows PC runnable Phar a is a good thing and not all users are allowed to use WSL2 even they can.

As we all know, do to the lack of Windows testers, we can not ensure all the function-ability of BOX3 on Windows.

But if we can add minimum tests on a virtual Windows env in our CI like below, it might be a good start to relieve our Windows worry-ness a little.

  1. Run bin/box.bat on virtual Windows env and create a simple phar file.
  2. Run a simple unit test for the created phar on virtual Win env.
  3. If the test passes then exit the CI with 0 status code.

To do so, I think we have 2 options so far.

  1. Use the official Vagrant box image of Win10 and run on TravisCI.
  2. Use the official GitHub-hosted runners of Windows Server 2019 and run on GitHub Actions.

Before any PR, I did some research and it seems that it might be possible.

My opinion is to implement a simple CI with GitHub Actions. But before drafting a PR for this feature I would like to hear your opinions.

What do you think?

theofidry commented 4 years ago

There is also AppVeyor: as per https://github.com/humbug/box/issues/193 I'm fine with enabling it but since I don't use Windows myself its support will be community based :)

KEINOS commented 4 years ago

since I don't use Windows myself its support will be community based :)

I agree, and it should be so.

It would be nice if it increases Windows' contributors a little more :)

I did a simple test of GitHub Actions.

And it was much easier than I thought. By just adding a single YAML file like below, we can run the tests on Windows.

So I would prefer to use GitHub Actions rather than TravisCI for Windows testing.

But before anything, I have to let the CI pass in the above sample. Since the composer is not working in the first place ... now I'm recalling why I switched to Docker ... 😖

owenvoke commented 4 years ago

@KEINOS, is that because there is a missing quote for the 7.4 ref? https://github.com/KEINOS/Practice_GitHub_Action-PHP_BOX3/blob/1233d1ab3dec6c134e7dbd92f1cc47d537427d3b/.github/workflows/php-win.yml#L8

-php-versions: ["7.2", "7.3", 7.4']
+php-versions: ["7.2", "7.3", '7.4']
KEINOS commented 4 years ago

@owenvoke

is that because there is a missing quote for the 7.4 ref?

O.M.G.! Σ( ̄□ ̄;)

owenvoke commented 4 years ago

Easy mistake to make, and frustrating. 😬

theofidry commented 2 years ago

@KEINOS sorry for the late reply. I'll happily accept a new Windows build (although will not set it as required) if one wants to provide one :)