michaelneu / webxcel

🤔 A REST backend built with plain VBA Microsoft Excel macros. Yes. Macros.
https://dev.to/michaelneu/to-vba-and-beyond---building-a-restful-backend-using-plain-microsoft-excel-macros-76n
MIT License
440 stars 70 forks source link

Find a way to provide CI builds #7

Open michaelneu opened 5 years ago

michaelneu commented 5 years ago

This project (obviously) needs an actual build passing badge badge. VBA didn't get much love from CI providers (yet): after 2 years of infrequently checking different providers, I think we're on our own here (surprisingly, nobody needs VBA macro CI? 🤔 ).

The best case would be to run tests and builds on actual Microsoft Excel, possibly with different versions. But this comes with a few issues. First, we need to have Microsoft Office installed. Most providers use Linux, which is neat for containers, so we'd need Wine and hope it works there, possibly even building a container. But since there are probably going to be issues, running on Windows would be better, which only leaves us with few providers such as AppVeyor, which only comes with developer tooling.

Technically, Chocolatey offers Microsoft Office installers. I haven't tried any of those, but I imagine there might be issues as well, possibly preventing automated installs. But even if we got automated installs going, there might be issues, first and foremost: licensing. If I use Office locally, it's covered under the EULA, but as soon as we use it to automate builds, there might be severe licensing issues, possibly not covered by a single-user license I'd try to get. This might be workable by approaching Microsoft, but it's still somewhat difficult to justify something like this for "I want to run automated builds for my Excel webserver" (though I think it'd be funny).

That aside, there's already a project running VBA macros out there: LibreOffice. Last time I checked, you could pretty much run Microsoft VBA code in LibreOffice Calc projects. There might be incompatibilities, but it might be the best case to run the builds at all.

I'm not sure how workable LibreOffice is and whether webxcel's macros work there (I haven't compared their specifications yet). If all fails, we'd need a separate runtime implementing the VBA specification, which obviously is a lot of work, just to provide a simple badge.

While I'm not sure what to do here, I'll leave this issue open and "up for grabs", maybe some day^tm we'll get automated builds because somebody managed to get it done. If everything fails and by 2050 (i.e. in 30 years) we don't have automated builds, I'll just add a dummy badge.

mohawk2 commented 4 years ago

I think this would be the way forward, if you were able to set up secrets with a suitable O365 tenant: https://pnp.github.io/office365-cli/concepts/github-actions/

michaelneu commented 4 years ago

Thank you for suggesting this!

I briefly looked into the project and installed it locally, but I'm not sure whether office365-cli will allow us to provide CI builds. As far as I understood from skimming through o365 help this action would allow us to manage a Microsoft 365 subscription and related services.

For our CI builds, we need a container/VM with at least Excel installed locally. I saw Chocolatey provides Office installers, but I didn't get around to try it in a headless Windows container yet. I'm also not sure how this works with Microsoft's EULA.

For actual CI, I considered using LibreOffice or building a VBA runtime myself, since I'm not sure getting Office installed on a CI provider is both possible and manageable in the long run. I updated the issue to reflect my thought process.

mohawk2 commented 4 years ago

My expectation would be that it would be unlikely LibreOffice's VBA implementation would be a good testbed for your code.

The EULA bit depends, I'd expect either you can use it or you can't, and CI ought to be fine. However I haven't looked into it as much as you have.