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

Problems trying to use GHA against 34_STABLE and 36_STABLE #79

Closed
stronk7 opened this issue Jan 30, 2021 · 2 comments
Closed

Problems trying to use GHA against 34_STABLE and 36_STABLE #79

stronk7 opened this issue Jan 30, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@stronk7
Copy link
Member

stronk7 commented Jan 30, 2021

Detected when using the suggested GHA file with local_codechecker.

I've created this branch that reproduces the problems within moodle-plugin-ci own tests:

https://github.com/stronk7/moodle-plugin-ci/actions/runs/523600001

Summary of mini-research performed till now follows:

Adding support for GHA in local_codechecker, it has been detected.
that the builds for 34 and 36 stable branches are failing badly.

But the Travis conunterparts are passing without a problem.

See:

For now, the mini-research performed points to:

  • 34_STABLE: That branch misses .nvmrc file and when that happens.
    moodle-plugin-ci does create it, pointing to lts/carbon. Travis
    seems to be getting that lts/carbon perfectly, but GHA is not,
    so it tries installing latest/current node version and that fails.

  • 36_STABLE: Not sure why but it's trying to download an incorrect
    node-sass binary. As far as the download fails... then tries to
    build it locally and that also fails. It works ok (correct download)
    both with travis, real linux, mac osx... not sure why not with GHA
    (I've seen "System Linux 5.4.0-1036-azure" is reported elsewhere in
    the logs... not sure if that may be the cause).

Maybe both are because of problems the the node / nvm stuff, or we are
executing something out of order, don't know. But certainly... the problem
with those 2 branches can be reproduced consistently. And they work
without a problem with Travis.

Ciao :-)

@kabalin
Copy link
Member

kabalin commented Feb 1, 2021

This is failing because nvm installation does not take place. You can see that at this line, nvm installation should take place just before global dependencies are installed, and it is not there (that is the case for any other CI runs also). It is a shame I did not investigate it properly after removing setup-node step.

There are two problems really:

  1. GHA shell is a bit unique - "Commands run using non-login shells by default.", this results that NVM_DIR is not available by default for the run process.
  2. In VendorInstaller class we check NVM_BIN presence. Even if we do point 1 right (so that login shell is used and we have NVM_DIR available), NVM_BIN is not defined there (perhaps a specific of nvm installation in GHA).

How to fix:

  1. There are two options here, either to define NVM_DIR at initialise step (see example in the patch below) or add shell: bash -l {0} to moodle-plugin-ci install step.
  2. NVM_BIN was added "just to be sure", it is not used anywhere apart of that check, it is totally sufficient to check NVM_DIR only to find out if nvm installation is there.

Here is the same verify_34_and_36_failures branch with a patch added: kabalin@786751d

It passes (well, 34-7.2 fails but for different reason)
https://github.com/kabalin/moodle-plugin-ci/actions/runs/528876252

And you can see that nvm installation takes place:
https://github.com/kabalin/moodle-plugin-ci/runs/1809887687?check_suite_focus=true#step:6:71

PS I used this thread to figure out the problem: actions/runner-images#4 (comment)

@stronk7
Copy link
Member Author

stronk7 commented Feb 1, 2021

Yay, great research!

@stronk7 stronk7 closed this as completed in 728ab73 Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants