ocaml-ci
ocaml-ci copied to clipboard
Don't cache the final build/test step
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.
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 @talex5 is this still a useful improvement?
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!