Tests are performed by building the relevant image and tagging it with the image name the tests expect. This follows the original implementation in test.sh. This will likely change to an explicit image name specification as we move the test suite in to Javascript but it's being maintained for now in the interest of simplicity.
Not have CI take a long time due to multi-architecture builds for interim pushes to pull requests.
CI should fail fast if any of the image builds or tests fail
Parallelize builds as much as possible.
Notes
Since the unprivileged and latest-njs images build off the base oss image, there were some strange moves that had to be done to make that work without rebuilding the base image every time. Specifically, we had to set setup-buildx-action to run in docker driver mode so we can simply load the base image. Otherwise we would have had to use a local repository. However, in docker mode upload-artifact doesn't like the file produced so we have to save the file again.
I wanted to build images once and then run tests against them and push at the end. However, there was not a clean way to get the full multi-architecture images all the way to the push step so I just build them again against all architectures and perform tests in the runner architecture. This saves us from needing conditionals in the test portions.
What
Allows us to push multi-architecture builds for
linux/amd64
andlinux/arm64
on merge to master. Fixes: https://github.com/nginxinc/nginx-s3-gateway/issues/196The flow looks like this:
Tests are performed by building the relevant image and tagging it with the image name the tests expect. This follows the original implementation in
test.sh
. This will likely change to an explicit image name specification as we move the test suite in to Javascript but it's being maintained for now in the interest of simplicity.Goals
Notes
unprivileged
andlatest-njs
images build off the baseoss
image, there were some strange moves that had to be done to make that work without rebuilding the base image every time. Specifically, we had to setsetup-buildx-action
to run indocker
driver mode so we can simplyload
the base image. Otherwise we would have had to use a local repository. However, indocker
modeupload-artifact
doesn't like the file produced so we have to save the file again.