Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
kabalin committed Aug 22, 2024
1 parent c9cd817 commit bfa3ff9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,8 +57,7 @@ jobs:

citest:
name: Integration tests
needs: selftest
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04

services:
postgres:
Expand Down Expand Up @@ -181,7 +180,7 @@ jobs:
phartest:
name: Integration tests (PHAR)
needs: buildphar
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04

services:
postgres:
Expand Down
9 changes: 3 additions & 6 deletions src/Installer/VendorInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bfa3ff9

Please sign in to comment.