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

allow specifying the Docker repo for 'tested_coq_opam_versions' for use in .travis.yml #57

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

chdoc
Copy link
Member

@chdoc chdoc commented Jun 25, 2020

This PR implements the enhancement proposed in #39

@chdoc chdoc force-pushed the specify-docker-repo branch from 53a5d54 to 467c9b3 Compare June 25, 2020 13:38
@chdoc
Copy link
Member Author

chdoc commented Jun 25, 2020

The linter seems to be unhappy, but it doesn't tell my why it's unhappy:
We are currently unable to download the log. Please try again later.

I used the modified template to generate the current CI setup for graph-theory

@chdoc chdoc linked an issue Jun 25, 2020 that may be closed by this pull request
@chdoc chdoc requested a review from palmskog June 25, 2020 13:45
Copy link
Member

@palmskog palmskog left a comment

Choose a reason for hiding this comment

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

The linter seemingly fails because ref.yml contains tabs, can you replace them with spaces?

Otherwise, looks good for .travis.yml, but note that it currently will not work for config.yml, i.e., for the Coq Docker GitHub Action. I suggest we immediately open an issue about this when this PR is merged, since I believe it will require input from @erikmd. It looks like config.yml currently can only use one Docker repo (currently fixed to coqorg/coq).

@chdoc chdoc force-pushed the specify-docker-repo branch from 467c9b3 to e91c735 Compare June 25, 2020 14:48
@chdoc
Copy link
Member Author

chdoc commented Jun 25, 2020

I fixed the spaces. If I understand correctly then config.yml should not be too hard to adapt, because it at least mentions the docker repository. So it should be possible to make this variable local to the various jobs. For coq-action.yml the change is probably not local to the the templates repository (it doesn't even mention coqorg/coq).

@erikmd
Copy link
Member

erikmd commented Jun 25, 2020

Hi @chdoc (Cc @palmskog)

For coq-action.yml the change is probably not local to the the templates repository (it doesn't even mention coqorg/coq).

the README does not mention the coqorg/coq repo because it is subsumed by the coq_version: _ syntax.
But actually you could from now on, take advantage of the generic custom_image: _ syntax.

E.g. you could update your PR and write something like this (without loss of expressivity) for the coq-action.yml template:

jobs:
  build:
    # the OS must be GNU/Linux to be able to use the docker-coq-action
    runs-on: ubuntu-latest
    strategy:
      matrix:
        coq_version:
{{# tested_coq_opam_versions }}
          - '{{ version }}'
{{/ tested_coq_opam_versions }}
      fail-fast: false
    steps:
    - uses: actions/checkout@v2
{{# submodule }}
    - name: Checkout submodules
      uses: textbook/git-checkout-submodule-action@2.1.1
{{/ submodule }}
    - uses: coq-community/docker-coq-action@v1
      with:
        opam_file: '{{ opam_name }}{{^ opam_name }}coq-{{ shortname }}{{/ opam_name }}.opam'
{{! The last-but-one interpolation changes delimiters to avoid interpreting the last one as mustache syntax. }}
        custom_image: {{ repo }}{{^ repo }}coqorg/coq{{/ repo }}{{=<% %>=}}:${{ matrix.coq_version }}

@erikmd
Copy link
Member

erikmd commented Jun 25, 2020

@palmskog

note that it currently will not work for config.yml, i.e., for the Coq Docker GitHub Action.

actually config.yml is the CircleCI config, not the GitHub action config.
Maybe @liyishuai should have a look as well for config.yml?

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.

Beyond my previous comments:
it also seems the ref.yml documentation spec should be further updated (the used: _ field is missing)

@palmskog
Copy link
Member

actually config.yml is the CircleCI config, not the GitHub action config.
Maybe @liyishuai should have a look as well for config.yml?

Thanks for catching that and for the insights on custom_image, we should actually make separate issues to address custom Docker repos/images for CircleCI and GitHub actions, respectively.

However, I don't think we should let that prevent merging of this PR.

@erikmd
Copy link
Member

erikmd commented Jun 25, 2020

@palmskog OK I don't mind.
but in this case, the PR should be renamed to include the "Travis CI" keyword or so, and update the ref.yml file (it only uses that new entry for .travis.yml currently)

@palmskog palmskog changed the title allow specifying the Docker repo for 'tested_coq_opam_versions' allow specifying the Docker repo for 'tested_coq_opam_versions' for use in .travis.yml Jun 25, 2020
@palmskog
Copy link
Member

it also seems the ref.yml documentation spec should be further updated (the used: _ field is missing)

Good catch again. @chdoc can you take care of this? I can merge after that when linting passes.

@chdoc
Copy link
Member Author

chdoc commented Jun 25, 2020

it also seems the ref.yml documentation spec should be further updated (the used: _ field is missing)

Good catch again. @chdoc can you take care of this? I can merge after that when linting passes.

I'm not sure how this used field is interpreted. version doesn't have one either. Is it "inherited" from tested_coq_opam_versions. Should I just add a used list (with - .travis.yml as only entry) to the repo list?

@palmskog
Copy link
Member

Should I just add a used list (with - .travis.yml as only entry) to the repo list?

This is at least my interpretation of the used list, so please go ahead.

@chdoc chdoc force-pushed the specify-docker-repo branch from e91c735 to 76e2c7f Compare June 25, 2020 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for alternative Docker images in Travis
3 participants