Skip to content

Commit

Permalink
Fix to NVM for ci purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Aug 31, 2024
1 parent a7299d9 commit 68ee246
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]
jobs:
test:
runs-on: 'ubuntu-latest'

services:
postgres:
image: postgres:13
Expand All @@ -29,43 +30,44 @@ jobs:
fail-fast: false
matrix:
include:
# - php: '8.1'
# moodle-branch: 'MOODLE_401_STABLE'
# database: 'mariadb'
- php: '8.1'
moodle-branch: 'master'
database: 'pgsql'
- php: '8.2'
moodle-branch: 'MOODLE_401_STABLE'
database: 'mariadb'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check out repository code
uses: actions/checkout@v2
with:
path: plugin

- name: Setup PHP
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
# none to use phpdbg fallback. Specify pcov (Moodle 3.10 and up) or xdebug to use them instead.
coverage: none

- name: Deploy moodle-plugin-ci
- 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
- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
# Add dirs to $PATH
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
# PHPUnit depends on en_AU.UTF-8 locale
sudo locale-gen en_AU.UTF-8
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
- name: Install Moodle
# Need explicit IP to stop mysql client fail on attempt to use unix socket.
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
- name: Install moodle-plugin-ci
run: |
moodle-plugin-ci add-plugin --branch MOODLE_402_STABLE catalyst/moodle-gradingform_rubric_ranges
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
IGNORE_PATHS: 'templates/local/mobile'

- name: PHP Lint
if: ${{ always() }}
Expand Down Expand Up @@ -97,13 +99,9 @@ jobs:
if: ${{ always() }}
run: moodle-plugin-ci savepoints

- name: Mustache Lint
if: ${{ always() }}
run: moodle-plugin-ci mustache

- name: Grunt
if: ${{ matrix.moodle-branch == 'master' }}
run: moodle-plugin-ci grunt
if: ${{ always() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
if: ${{ always() }}
Expand Down

0 comments on commit 68ee246

Please sign in to comment.