From bfa3ff9e3a0f1bd0ee6490c46a97377572f8e729 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Thu, 22 Aug 2024 00:13:54 +0100 Subject: [PATCH] tmp --- .github/workflows/test.yml | 7 +++---- src/Installer/VendorInstaller.php | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1a8c706..f76716ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch] jobs: selftest: name: CI test (make validate) - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - name: Check out repository code @@ -57,8 +57,7 @@ jobs: citest: name: Integration tests - needs: selftest - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 services: postgres: @@ -181,7 +180,7 @@ jobs: phartest: name: Integration tests (PHAR) needs: buildphar - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 services: postgres: diff --git a/src/Installer/VendorInstaller.php b/src/Installer/VendorInstaller.php index dc89d994..1fc92263 100644 --- a/src/Installer/VendorInstaller.php +++ b/src/Installer/VendorInstaller.php @@ -15,7 +15,6 @@ use MoodlePluginCI\Bridge\Moodle; use MoodlePluginCI\Bridge\MoodlePlugin; use MoodlePluginCI\Process\Execute; -use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\Process; /** @@ -112,16 +111,14 @@ public function canInstallNvm(): bool */ public function installNvm(): void { - $nvmDir = "{$this->moodle->directory}/.nvm"; - (new Filesystem())->mkdir($nvmDir); - $cmd = "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | NVM_DIR=\"{$nvmDir}\" bash"; + $cmd = 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash'; $process = $this->execute->passThroughProcess( Process::fromShellCommandline($cmd, $this->moodle->directory, null, null, null) ); if (!$process->isSuccessful()) { throw new \RuntimeException('nvm installation failed.'); } - putenv('NVM_DIR=' . $nvmDir); + putenv('NVM_DIR=$HOME/.nvm'); } /** @@ -155,7 +152,7 @@ public function installNode(): void } $nvmDir = getenv('NVM_DIR'); - $cmd = ". $nvmDir/nvm.sh && nvm install && nvm use && echo \"NVM_BIN=\$NVM_BIN\""; + $cmd = ". {$nvmDir}/nvm.sh && nvm --version"; $process = $this->execute->passThroughProcess( Process::fromShellCommandline($cmd, $this->moodle->directory, null, null, null)