9 - v[0-9]+.[0-9]+.[0-9]+*
19 - name: Checking out code
20 uses: actions/checkout@v3
22 - name: Configuring node & npm
23 uses: actions/setup-node@v3
25 node-version-file: '.nvmrc'
27 - name: Installing node stuff
33 - name: Looking for uncommitted changes
34 # Add all files to the git index and then run diff --cached to see all changes.
35 # This ensures that we get the status of all files, including new files.
36 # We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
39 git reset -- npm-shrinkwrap.json
40 git diff --cached --exit-code
43 runs-on: ${{ matrix.os }}
46 image: moodlehq/moodle-exttests
57 # MySQL builds always run with the lowest PHP supported version.
62 # PostgreSQL builds always run with the highest PHP supported version.
68 - name: Setting up DB mysql
69 if: ${{ matrix.db == 'mysqli' }}
70 uses: moodlehq/mysql-action@v1
72 collation server: utf8mb4_bin
79 extra conf: --skip-log-bin
81 - name: Setting up DB pgsql
82 if: ${{ matrix.db == 'pgsql' }}
83 uses: m4nu56/postgresql-action@v1
85 postgresql version: 13
88 postgresql password: test
90 - name: Configuring git vars
91 uses: rlespinasse/github-slug-action@v4
93 - name: Setting up PHP ${{ matrix.php }}
94 uses: shivammathur/setup-php@v2
96 php-version: ${{ matrix.php }}
97 extensions: ${{ matrix.extensions }}
98 ini-values: max_input_vars=5000
101 - name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
102 uses: actions/checkout@v3
104 - name: Setting up PHPUnit
106 dbtype: ${{ matrix.db }}
108 echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
109 cp .github/workflows/config-template.php config.php
111 sudo locale-gen en_AU.UTF-8
112 php admin/tool/phpunit/cli/init.php --no-composer-self-update
114 - name: Running PHPUnit tests
116 dbtype: ${{ matrix.db }}
117 phpunit_options: ${{ secrets.phpunit_options }}
118 run: vendor/bin/phpunit $phpunit_options