exercism / sml

Exercism exercises in Standard ML.
https://exercism.org/tracks/sml
MIT License
26 stars 33 forks source link

Can we cache the SML build for the CI? #207

Closed guygastineau closed 1 year ago

guygastineau commented 2 years ago

We are downloading and rebuilding a specific version of poly every time we run the CI. It only takes about 1.5 minutes, but our CI would be almost instantaneous without this step. Is there some way to cache it? 2022-06-16_09:18:42_selected

ErikSchierboom commented 2 years ago

What you could do, is to use the exercism/sml-test-runner image and run the tests within that, as it will contain the SML setup. Additional benefit: this would be a proper integration test.

For an example on how to do this, see the AWK test runner:

guygastineau commented 2 years ago

It looks to me like the AWK tests are still installking gawk in the container every time unless I am missing something https://github.com/exercism/awk/blob/main/.github/workflows/ci.yml

I read the dockerfile for exercism/sml-test-runner, but if the image is not pushed to dockerhub I am not sure how to use it from the ci.yml here?

guygastineau commented 2 years ago

FWIW, polyml is available in the official community repository for arch linux. Maybe that would simplify the docke files... of course, it is a slightly newer version of polyml.

guygastineau commented 2 years ago

Oh, interesting, ubuntu 22.04 appears to have polyml, but it is one minor version behind what we build and install whereas arch linux is one minor version ahead.

ErikSchierboom commented 2 years ago

I read the dockerfile for exercism/sml-test-runner, but if the image is not pushed to dockerhub I am not sure how to use it from the ci.yml here?

It is automatically pushed each time a commit is made to the main branch: https://github.com/exercism/sml-test-runner/runs/6405331000?check_suite_focus=true

It looks to me like the AWK tests are still installking gawk in the container every time unless I am missing something https://github.com/exercism/awk/blob/main/.github/workflows/ci.yml

Looks like they changed things around a bit. A better example: https://github.com/exercism/abap/blob/main/.github/workflows/test.yml and https://github.com/exercism/abap/blob/main/bin/test

guygastineau commented 2 years ago

Ah, thank you for the clarifications. I will try to set it up.

rainij commented 1 year ago

I will have time for this soon.

ErikSchierboom commented 1 year ago

@rainij In case you hadn't seen it, please read this forum post that I wrote about speeding up CI (you might be able to apply its lessons here too): https://forum.exercism.org/t/speeding-up-test-runner-ci-runs/927/1