diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index f9709cb..6a75801 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -4,6 +4,7 @@ on: [push, pull_request] jobs: test: runs-on: 'ubuntu-latest' + services: postgres: image: postgres:13 @@ -29,43 +30,43 @@ jobs: fail-fast: false matrix: include: - # - php: '8.1' - # moodle-branch: 'MOODLE_401_STABLE' - # database: 'mariadb' - php: '8.1' - moodle-branch: 'master' - database: 'pgsql' + moodle-branch: 'MOODLE_404_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 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() }} @@ -97,13 +98,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() }}