Closed PhilippImhof closed 2 weeks ago
Test run on main branch fails too. Latest release of ubuntu-22.04 bumped nvm to 0.40.0. Looks to me as related https://github.com/nvm-sh/nvm/issues/3405.
Maybe actions/setup-node
is a more reliable way to install Node.js?
Coincidentally I arrived to this issue, worth checking it. It seems that some incompatibility between nvm (that we use to install the target nodejs version) and GitHub actions may be the root of the problem: https://github.com/nvm-sh/nvm/issues/3405
A fix is being worked on, based on the last comments there…
Ah, @kabalin , just saw your comment now! Snap!
A fix is being worked on, based on the last comments there…
Yeah, runner-images would need to be updated too following the fix in nvm, will take time. Temporary workaround is to install nvm 0.39.7 explicitly like at #310.
Just to note, if we go for GH Action #303 (#53), this could be easily fixed for everyone without need to add workaround to individual workflows.
Solved mine temporarily by adding the following before Install moodle-plugin-ci
step
- name: Install NVM and Node
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 20
nvm use 20
Just a temporary fix before this plugin is updated
Just a temporary fix before this plugin is updated
So, you are installing version 20 explicitly, can you share the workflow? I would expect install step to fail as it only bypass node installation if NVM_DIR
is undefined. Installing v0.40.0 is not necessary, it is already of that version in ubuntu-22.04
image we use (which actually cause of regression).
The easiest workaround for now is described in #310, a one-liner fix to downgrade nvm.
set +e
is a much easier workaround than downgrading nvm, fwiw.
set +e
is a much easier workaround than downgrading nvm, fwiw.
Hmm, does not seem have effect (unless I am using it wrong way) https://github.com/kabalin/moodle-plugin-ci/actions/runs/10384715590/job/28752387566#step:6:168
You're using it correctly afaict (altho . /home/runner/.nvm/nvm.sh && nvm install && nvm use
can just be . /home/runner/.nvm/nvm.sh --install
), but I only see a moodle error and not the actual result of running that command?
See https://github.com/moodlehq/moodle-plugin-ci/pull/310#issuecomment-2297629714 for suggestion to make this nvm installation permanent part of workflow.
We fixed this in 4.5.4 release, those who added temporary workaround can safely remove it. Sorry for delaying the fix and thanks for your patience :)
@kabalin Thank you so much! Can a similar fix be applied to the 3.x branch? We still do some testing against older versions which do not work with 4.x
@kabalin Thank you so much! Can a similar fix be applied to the 3.x branch? We still do some testing against older versions which do not work with 4.x
Yep, the fix has been released for 3.x too.
fwiw v0.40.1 of nvm has been released, which should fix this issue.
A few days ago, some of my CI checks randomly failed at the
install moodle-plugin-ci
step. After a few retries, all checks finally passed. In the meantime, things have become worse. Currently, all checks are constantly failing. Some other developers reported the same in the dev chat.