Skip to content

Commit

Permalink
Test with ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
kabalin committed Aug 22, 2024
1 parent b16a63a commit c54c399
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 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-22.04
runs-on: ubuntu-24.04

steps:
- name: Check out repository code
Expand All @@ -28,7 +28,7 @@ jobs:
coverage:
if: github.repository == 'moodlehq/moodle-plugin-ci'
name: Code coverage (codecov)
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Check out repository code
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
citest:
name: Integration tests
needs: selftest
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

services:
postgres:
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
buildphar:
name: Build moodle-plugin-ci.phar
needs: selftest
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Check out repository code
Expand All @@ -179,7 +179,7 @@ jobs:
phartest:
name: Integration tests (PHAR)
needs: buildphar
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

services:
postgres:
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
selfupdatetest:
name: SelfUpdate tests (PHAR)
needs: buildphar
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
lowest_release: '4.1.8'

Expand Down
10 changes: 6 additions & 4 deletions src/Installer/VendorInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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,15 +113,16 @@ public function canInstallNvm(): bool
*/
public function installNvm(): void
{
$cmd = 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash';
$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";
$process = $this->execute->passThroughProcess(
Process::fromShellCommandline($cmd, $this->moodle->directory, null, null, null)
);
if (!$process->isSuccessful()) {
throw new \RuntimeException('nvm installation failed.');
}
$home = getenv('HOME');
putenv("NVM_DIR={$home}/.nvm");
putenv("NVM_DIR={$nvmDir}");
}

/**
Expand Down Expand Up @@ -154,7 +156,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 install && nvm use && echo \"NVM_BIN=\$NVM_BIN\"";

$process = $this->execute->passThroughProcess(
Process::fromShellCommandline($cmd, $this->moodle->directory, null, null, null)
Expand Down

0 comments on commit c54c399

Please sign in to comment.