File tree Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 8282 echo "TRAVIS_BUILD_DIR="$(cd ../moodle-local_travis; pwd) >> $GITHUB_ENV
8383 # PHPUnit depends on en_AU.UTF-8 locale
8484 sudo locale-gen en_AU.UTF-8
85+ # Define NVM_DIR pointing to nvm installation.
86+ echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
8587
8688 - name : Install moodle-plugin-ci
8789 run : moodle-plugin-ci install -vvv
Original file line number Diff line number Diff line change @@ -9,7 +9,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99The format of this change log follows the advice given at [ Keep a CHANGELOG] ( http://keepachangelog.com ) .
1010
1111## [ Unreleased]
12- No unreleased changes.
12+ ### Fixed
13+ - ` nvm ` availability check to make it work correctly in GHA
14+ - ACTION REQUIRED: If you are using GitHub Actions, add ` NVM_DIR ` definition
15+ in "Initialise moodle-plugin-ci" step. Without it ` nvm ` can't be used for
16+ node version switching, see the step definition at
17+ [ gha.dist.yml] ( https://github.com/moodlehq/moodle-plugin-ci/blob/master/gha.dist.yml )
18+ and add missing ` NVM_DIR ` line your plugin's GHA workflow file.
19+
1320
1421## [ 3.0.4] - 2021-01-29
1522### Fixed
Original file line number Diff line number Diff line change @@ -92,13 +92,14 @@ jobs:
9292 coverage : none
9393
9494 # Install this project into a directory called "ci", updating PATH and
95- # locale.
95+ # locale, define nvm location .
9696 - name : Initialise moodle-plugin-ci
9797 run : |
9898 composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
9999 echo $(cd ci/bin; pwd) >> $GITHUB_PATH
100100 echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
101101 sudo locale-gen en_AU.UTF-8
102+ echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
102103
103104 # Run the default install.
104105 # Optionally, it is possible to specify a different Moodle repo to use
Original file line number Diff line number Diff line change 4949 echo $(cd ci/bin; pwd) >> $GITHUB_PATH
5050 echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
5151 sudo locale-gen en_AU.UTF-8
52+ echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
5253
5354 - name : Install moodle-plugin-ci
5455 run : |
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ public function stepCount()
102102 */
103103 public function canInstallNode ()
104104 {
105- return getenv ('NVM_DIR ' ) && getenv ( ' NVM_BIN ' );
105+ return ! empty ( getenv ('NVM_DIR ' ));
106106 }
107107
108108 /**
You can’t perform that action at this time.
0 commit comments