This is a continuation of work done by @eds-collabora in !275
This replaces the old, simpler pipeline with a three phase process:
- First, build the image and cache it using docker buildx.
- Second, run all the tests in parallel, restoring the image from the cache.
- Thirdly, if the tests pass:
- if this is a push to the main branch, push to DockerHub.
- push to GitHub Container registry (PS: will push to a user's own fork).
This uses Buildkit caching aggressively, and will make use of the entire 5GiB allocation of cache space that GitHub provides over time.
It requires the following additional repository secrets:
- DOCKERHUB_USERNAME: the username to login as on DockerHub (e.g. go-debos)
- DOCKERHUB_PASSWORD: an access token for the DockerHub repository.
Closes: #275
Based on original work by: Ed Smith <ed.smith@collabora.com>
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
Currently only the unit-tests under the actions directory are ran. This
patch runs all of the available unit tests in the project.
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
This allows to automatically run debos unit test on dockerhub when
a build is triggered.
The unit test are run on "builder" target image, which needs to make
GOPATH available from the container and add go packages dependency for
the test.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>