Closed djdv closed 3 years ago
It may also be worth separating tests that need privileges from those that don't. ... Note that while the test schema should work, the service tests themselves on Linux are going to need an upstream patch to the "service" pkg they depend on.
Moving any further changes to the service PR. This is a good enough template.
Nobody should notice this but history was re-written. https://github.com/djdv/go-filesystem-utils/commit/679dc6ea7fcc34d3ac974809f7fbc5cc8e508822 -> https://github.com/djdv/go-filesystem-utils/commit/1af1e26f3fd1b4e5045e69c8a267f660d50c2120 This should be the only time master gets a force push, and only because nobody is using this yet. The old version didn't actually work the way it claimed to and I don't want someone to see it in history and copy it expecting it to work correctly.
I'm not familiar with GitHub actions yet so any suggestions are welcome.
This works for the platforms specified, but could probably be better. The version of Go used is pulled from the go.mod header which is used with
actions/setup-go
. Not sure if usingGITHUB_ENV
is preferable to actionoutputs
or even something else.I think the directories being cached should probably be platform dependent so we're not storing and restoring everything. But I don't know how to better split that up yet.
The non-Windows tests need root privileges to install and control the service. But sudo's $PATH doesn't see the Go installed from
setup-go
, (it calls the CI's preinstalled Go instead) even with-E
it seems$PATH
is protected. As a workaround we find the path and call it manually. If there's a better way, we should do that instead. This feels like the wrong way to do it. It may also be worth separating tests that need privileges from those that don't.Note that while the test schema should work, the service tests themselves on Linux are going to need an upstream patch to the "service" pkg they depend on.