Closed giordano closed 9 months ago
Thanks for the suggestion. I do I agree that is not very nice and can bring even inconsistencies/incompatibilities. I was thinking to have a separate repository for the examples. Keeping the core package small and with less dependencies. In this way people can clone them to run and eventually use them as starting point for their application. The problem is that as part of the CI I run the examples as regression tests and this now will be in a different repositories that I would need to synch. Do you have any suggestion for this? Perhaps I can include the examples repository as a git submodule for the tests.
I think having the example
folder in the same repo is fine! you can just have a function something like:
Geant4.example_path() = joinpath(dirname(@__DIR__), "examples")
(@__DIR__
will be src/
, so dirname()
should bring us to the root directory of the repo
@giodano I moved all the examples to a new package G4Examples and added it as a git submodule. The development is still nice and convenient, and I can run the CI tests and generate the documentation that uses these examples. But, when registering the package to Julia I get the error:
Cloning [559df036-b7a0-42fd-85df-7d5dd9d70f44] Geant4 from https://github.com/JuliaHEP/Geant4.jl.git
ERROR: GitError(Code:ERROR, Class:Submodule, cannot get submodules without a working tree)
According to https://github.com/JuliaLang/Pkg.jl/issues/708 I cannot use submodules and I must remove them, but then the CI will fail. Do you know a solution to this dilemma?
I think you can use Pkg.develop()
for CI
Can you do it without having the examples dir as a submodule? How are you using it?
I am using sub-module because of the convenience during development (with VScode I can modify the code and the examples coherently). For the CI, to run the tests and produce the docs, I just need to do:
- uses: actions/checkout@v2
with:
submodules: recursive
and it works. I guess I would need to remove the submodule and do an explicit checkout on the CI to please the Julia registration process
This is now done. The CI checkout explicitly the examples repository with:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout G4Examples
uses: actions/checkout@v2
with:
repository: JuliaHEP/G4Examples.jl
path: examples
The README and docs does not suggest to clone this repository, instead to clone the G4Examples. Closing the issue.
The documentation shouldn't recommend cloning the repository, since the package is already available anyway. If this was only meant to run the examples, one can do something like this: