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

Add CircleCI template #28

Merged
merged 5 commits into from
May 27, 2020
Merged

Add CircleCI template #28

merged 5 commits into from
May 27, 2020

Conversation

liyishuai
Copy link
Member

@liyishuai liyishuai commented May 15, 2020

Resolve #1

Todo

  • Test compatibility with existing projects
  • Update generate.sh

@liyishuai liyishuai requested review from Zimmi48 and erikmd May 15, 2020 05:07
@liyishuai liyishuai force-pushed the circleci branch 2 times, most recently from 79ebff7 to 3db4713 Compare May 15, 2020 05:13
@Zimmi48
Copy link
Member

Zimmi48 commented May 15, 2020

It seems to me that there are differences with the other CI templates that should not be specific to CircleCI like the use of extra-dev and the coinstability testing. Should we also add these to the other templates? cc @erikmd

Copy link
Member

@erikmd erikmd left a comment

Choose a reason for hiding this comment

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

Hi @Zimmi48 @liyishuai (sorry for late reply)

It seems to me that there are differences with the other CI templates that should not be specific to CircleCI like the use of extra-dev

Indeed. Actually the extra-dev repo (as well as core-dev) is already included in coqorg/coq:dev based images, while coqorg/coq:latest and other stable images only contain released.

I see no objection of adding extra-dev as well in other templates (e.g. in this PR as well) because I guess the master branch of some coq-community repos could have some dependency in extra-dev (even if maybe this situation did not occur up to now).

and the coinstability testing. Should we also add these to the other templates?

Regarding coinstability testing:

  1. if we want to merge that feature, indeed the templates for Travis/CircleCI/GitHub-Actions should be consistent and updated accordingly.
  2. However I'm a bit split on merging this feature, because unlike e.g. Coq's CI, this test is not really "reproducible", as (i) the packages to be tested are not specified, (ii) if one of an un-specified coinstallable package is not compatible and no release comes up to fix the build test, basically the build will always fail.

So I'd suggest to:

  • add a line opam repository add --all-switches --set-default coq-extra-dev https://coq.inria.fr/opam/extra-dev in all templates (I suggest to add the --set-default CLI flag)
  • remove the code if ! [ -z "$PACKAGES" ]; then opam install -t $PACKAGES; fi (or at least, comment-out this code and document its drawbacks)

@erikmd
Copy link
Member

erikmd commented May 23, 2020

Also, as mentioned in the original post, the script generate.sh should be updated accordingly

- checkout
- run:
name: Pull submodules
command: git submodule update --init --remote
Copy link
Member

Choose a reason for hiding this comment

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

Is this yet another subtle difference between this template and the other CI templates?

Copy link
Member

Choose a reason for hiding this comment

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

I think so… Maybe adding this git submodule part is unneeded for the default coq-community templates? at least for the time being (IMHO the three CI templates should be as close as possible semantically one from the other, and later on other PRs could just as well add features that enhance them, in a row?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Travis CI clones Git submodules by default. I've added submodule for GitHub Actions.

Copy link
Member

Choose a reason for hiding this comment

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

OK! have you checked that this is exactly that command triggered by Travis for git submodule cloning?

(I'm not very submodule-savvy, but e.g. this blog https://mgalgs.github.io/2014/07/03/git-submodule-update-init-remote-recursive-considered-harmful.html mentions the following commands: git submodule update --init --recursive; git submodule update --remote)

Copy link
Member Author

Choose a reason for hiding this comment

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

Travis uses git submodule update --init --recursive. Should I just drop --remote?

Copy link
Member

@erikmd erikmd May 27, 2020

Choose a reason for hiding this comment

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

Maybe yes − this option is documented here:
https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt---remote ;
it appears to be related to remote-tracking branches (which would be a bit off-topic in the context of CI builds?)

Copy link
Member

Choose a reason for hiding this comment

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

and this complies with the doc of GitLab CI as well:
https://docs.gitlab.com/ee/ci/git_submodules.html#using-git-submodules-in-your-ci-jobs
so git submodule update --init --recursive seems the way to go

Copy link
Member

Choose a reason for hiding this comment

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

(actually the GItLab CI page I mentioned suggests two lines)

git submodule sync --recursive
git submodule update --init --recursive

config.yml.mustache Show resolved Hide resolved
config.yml.mustache Outdated Show resolved Hide resolved
config.yml.mustache Outdated Show resolved Hide resolved
Copy link
Member

@erikmd erikmd left a comment

Choose a reason for hiding this comment

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

Good idea, the fact to add an option ci_test_dependants

@liyishuai do you plan to add a similar script in Travis / GitHub Actions templates? or in a later PR.

@liyishuai
Copy link
Member Author

@liyishuai do you plan to add a similar script in Travis / GitHub Actions templates? or in a later PR.

Added to Travis.
For GitHub Actions, we need to:

  1. Add option for testing dependants in https://github.com/coq-community/docker-coq-action
  2. Configure the option via ci_test_dependants.

@erikmd
Copy link
Member

erikmd commented May 27, 2020

Hi @liyishuai

For GitHub Actions, we need to:

  1. Add option for testing dependants in https://github.com/coq-community/docker-coq-action
  2. Configure the option via ci_test_dependants.

Good point. So this can be done in a later PR maybe, indeed

Copy link
Member

@erikmd erikmd left a comment

Choose a reason for hiding this comment

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

@liyishuai the PR LGTM, thanks! (you just might want to further simplify the opam-list command to PINS=$(opam list -s --pinned --columns=package | xargs | tr ' ' ,), but that's a detail)

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.

CircleCI template
3 participants