zephyrproject-rtos / west

West, Zephyr's meta-tool
https://docs.zephyrproject.org/latest/guides/west/index.html
Apache License 2.0
215 stars 117 forks source link

Add docker compose based test environment for Linux #687

Open mbolivar-ampere opened 9 months ago

mbolivar-ampere commented 9 months ago

When preparing a west release, we like to make sure that it works on more Linux environments than whatever is currently tested in GitHub CI. Doing this by hand is a pain. Add some automation for making this more painless.

marc-hb commented 9 months ago

Nice! No time to review at this moment but if you're looking for some Windows inspiration you can find some here:

https://github.com/thesofproject/sof/blob/main/.github/workflows/zephyr.yml

https://github.com/thesofproject/sof/actions/workflows/daily-tests.yml

marc-hb commented 9 months ago

I dunno much about Docker unfortunately...

One thing we learned in SOF though; the Dockerfiles should be in a separate repo:

Except for "unit" test code which is very dependent on the version of the production code it's testing, you usually want the convenience to combine any version of test code with any version of production code. Typically: git bisect production code with the latest version of test code. Or here: git bisect with the latest docker image.

Now don't get me wrong: anyone can take 2 random git repos mostly unrelated to each other, merge them into one and start interleaving their unrelated development histories. It is totally possible and even not that uncommon (especially when you don't know about west ;-) But it's really not convenient when the two projects have totally unrelated life cycles and release cycles.

Another instance: every Dockerfile change should trigger some Github Action that rebuilds the container and runs the test suite again. But any Dockerfile CI takes a very long time so you don't want that to happen for mosts west PRs which do NOT change any Dockerfile. Congratulations, now you need a path-based filter on every Github Action to separate two different CIs that should have never been together in the first place. Possible but pretty inconvenient.

mbolivar-ampere commented 9 months ago

One thing we learned in SOF though; the Dockerfiles should be in a separate repo:

This is meant for manual testing on various distros at release time; can we keep things simple for now?