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

Syntax for opam-repositories ? #813

Closed
fblanqui opened this issue Jun 20, 2024 · 8 comments · Fixed by #814
Closed

Syntax for opam-repositories ? #813

fblanqui opened this issue Jun 20, 2024 · 8 comments · Fixed by #814
Labels
documentation Improvements or additions to documentation

Comments

@fblanqui
Copy link

Hello. Could you please describe the syntax to use for opam-repositories, and give some examples?

@smorimoto
Copy link
Member

It's expected to be the YAML mapping: https://yaml.org/spec/1.2.2/#nodes

default: https://github.com/ocaml/opam-repository.git

or

default: https://github.com/ocaml/opam-repository.git
beta: https://github.com/ocaml/ocaml-beta-repository.git

@fblanqui
Copy link
Author

I see. Thank you. Is https://github.com/ocaml/opam-repository.git used even if not mentioned?

@fblanqui
Copy link
Author

Note that in README.md it is written that it is of type string, which is a little confusing (I'm not super familiar with yaml).

@smorimoto
Copy link
Member

Is https://github.com/ocaml/opam-repository.git used even if not mentioned?

Yes, it's the default opam repository.

Note that in README.md it is written that it is of type string, which is a little confusing (I'm not super familiar with yaml).

Although it's actually technically just string, because of GHA restrictions, its actual content is the YAML mapping...

@fblanqui
Copy link
Author

Sorry but I still have some syntactic issue: "A mapping was not expected". What is wrong with the following?

      - name: Install ocaml and opam
        uses: ocaml/setup-ocaml@v2
        with:
          ocaml-compiler: 4.14.0
          opam-repositories:
            default: https://github.com/ocaml/opam-repository.git
            beta: https://github.com/ocaml/ocaml-beta-repository.git

@smorimoto
Copy link
Member

Try this:

       - name: Install ocaml and opam
         uses: ocaml/setup-ocaml@v2
         with:
           ocaml-compiler: 4.14.0
-          opam-repositories:
+          opam-repositories: |
             default: https://github.com/ocaml/opam-repository.git
             beta: https://github.com/ocaml/ocaml-beta-repository.git

@smorimoto smorimoto added the documentation Improvements or additions to documentation label Jun 20, 2024
@fblanqui
Copy link
Author

It works. Thank you!

@smorimoto
Copy link
Member

Note that, in general, you do not have to add or change the repository. Addition, the higher item has higher priority.

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

Successfully merging a pull request may close this issue.

2 participants