ocaml-ci icon indicating copy to clipboard operation
ocaml-ci copied to clipboard

Don't cache the final build/test step

Open talex5 opened this issue 5 years ago • 3 comments

If you re-build a successful run, you probably want to try the tests again (to see if they're flaky). We should probably remove the last line from the generated Dockerfile and run it using docker run instead, so there's no caching.

A side-effect of this is that we'd run the build step twice for PRs (once in the upstream repository and once in the fork). However, the final step is usually fairly quick, and it would mean that you get to see the test output in both places.

talex5 avatar May 19 '20 08:05 talex5

It is nice not having to split between docker build and run right now. Since we're using buildkit, we could use this neat trick from https://github.com/moby/moby/issues/1996#issuecomment-550020843

Generate the last line as:

ARG TEST_RUN_AT
RUN opam exec -- dune runtest

And execute the build with docker build --build-arg TEST_RUN_AT=$datetime so that every rebuild can modify that. A less nice alternative is to ADD an ever changing URL just before the dune runtest.

avsm avatar Jul 26 '20 20:07 avsm

@avsm @talex5 is this still a useful improvement?

tmcgilchrist avatar Sep 04 '23 07:09 tmcgilchrist

I would expect so, but with OBuilder rather than Docker now. Some kind of "dont-cache-result" flag there might be useful. Might save a fair bit of disk space too!

talex5 avatar Sep 05 '23 00:09 talex5