metanorma / metanorma-cli

CLI (Command Line Interface) for Metanorma
BSD 2-Clause "Simplified" License
5 stars 5 forks source link

Run Gemfile.devel in Github Actions with metanorma-cli #317

Closed opoudjis closed 11 months ago

opoudjis commented 11 months ago

As alerted in https://github.com/metanorma/isodoc/issues/546 , Gemfile.devel is ignored in GitHub Actions when running metanorma-cli. Alex has done some fixes, which have made it possible for the metanorma-cli spec file to run correctly with the Gemfile.devel branches of underlying gems. But the samples it contains are still being run with the main branch as far as I can tell: they are crashing in the XSLT preprocessing line of the main branch of isodoc, which is different from the corresponding line in the branch of isodoc named in Gemfile.devel.

As I have found in my own running of metanorma-cli, any system calls to metanorma need to be put as bundle exec metanorma, in order to pick up the Gemfile.devel; it may also be that the system calls are not picking up Gemfile.devel in their environment.

I am doing a new release which may address the bug I'm trying to rectify; but the ability to run samples with branches named in Gemfile.devel in GitHub Actions remains a requirement. Especially if the fix I'm working with fails.

CAMOBAP commented 11 months ago

As I have found in my own running of metanorma-cli, any system calls to metanorma need to be put as bundle exec metanorma, in order to pick up the Gemfile.devel; it may also be that the system calls are not picking up Gemfile.devel in their environment.

According to my understanding we have to avoid any system("metanorma ...") calls in specs

But the samples it contains are still being run with the main branch

Sorry I completely missing this part, i'm not sure how easy it will be to automate it, but let me try

opoudjis commented 11 months ago

According to my understanding we have to avoid any system("metanorma ...") calls in specs

Perhaps, but it's not my code, it's @abunashir ’s, and I'm disinclined to be the one to fix it. And the point of this spec is to test that the system call to metanorma is working.

CAMOBAP commented 11 months ago

Samples/templates testing now should take in account Gemfile.devel restarting CI

Update: link to the run https://github.com/metanorma/metanorma-cli/actions/runs/6963118635

CAMOBAP commented 11 months ago

Test failed, one more update required, will rerun CI soon

Update: link to the run https://github.com/metanorma/metanorma-cli/actions/runs/6963118635

opoudjis commented 11 months ago

It's working, as I confirmed last night. Ticket stays open until the various random errors on running template also go away.

opoudjis commented 11 months ago

The new issue with templates appears to be mostly 2.7, and GHA hanging at:

  if [ "3.2" = "2.7" ]; then
    gem install lightly -v 0.3.3
  fi
  gem install metanorma-cli

https://github.com/metanorma/metanorma-cli/actions/runs/7011812490

ronaldtse commented 11 months ago

As a matter of principle I think version constraints must be stated in the gemspec, not in build scripts.

CAMOBAP commented 11 months ago

This one was a workaround which I hope can be removed already, I will do after release

opoudjis commented 11 months ago

@CAMOBAP can this issue close?

CAMOBAP commented 11 months ago

@opoudjis I hope so