Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI/CD #183

Merged
merged 6 commits into from
Sep 8, 2020
Merged

Improve CI/CD #183

merged 6 commits into from
Sep 8, 2020

Conversation

tmattio
Copy link
Collaborator

@tmattio tmattio commented Sep 8, 2020

This PR improves the CI CD by:

  • Caching Opam dependencies
  • Installing dependencies from lock files, which will make the builds more reproducible
  • Splitting the steps and giving them names to identify failures quickly

@tmattio tmattio merged commit ec3b960 into rgrinberg:master Sep 8, 2020
@tmattio tmattio deleted the ci-cd-improvements branch September 8, 2020 23:53
@anuragsoni
Copy link
Collaborator

@tmattio restoring cache might cause issues with a later switch creation. Right now the ocaml action uses opam switch create "$1" "$1" to create a switch. I think that'll fail if there's an existing switch with the same name already present.

https://github.com/avsm/setup-ocaml/blob/4b93f69dd17a2b0bd35732d2573e57e307085f1e/lib/install-ocaml-unix.sh#L11

@tmattio tmattio mentioned this pull request Sep 9, 2020
@tmattio
Copy link
Collaborator Author

tmattio commented Sep 9, 2020

@anuragsoni That's what I noticed after merging. I'll comment out the caching part until there is a workaround. That's a shame, the CI went from taking 20min to 2min!

opam install . --deps-only --with-doc --with-test --locked --unlock-base
opam install ppx_sexp_conv base64 ppx_yojson_conv --skip-updates

- name: Upgrade dependencies

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is NOT for upgrade. This step checks the consistency of the installed opam packages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @smorimoto! I made the changes in #184

if: steps.cache-opam.outputs.cache-hit != 'true'
run: opam install ocamlformat

- name: Upgrade dependencies

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants