AutorÃa | Ultima modificación | Ver Log |
name: Coreon:push:branches-ignore:- main- MOODLE_[0-9]+_STABLEtags-ignore:- v[0-9]+.[0-9]+.[0-9]+*workflow_dispatch:inputs:phpunit_extra_options:description: Additional options to apply to PHPUnitrequired: falsedefault: ''env:php: 8.4jobs:Grunt:runs-on: ubuntu-24.04steps:- name: Checking out codeuses: actions/checkout@v4- name: Configuring node & npmuses: actions/setup-node@v4with:node-version-file: '.nvmrc'- name: Installing node stuffrun: npm install- name: Running gruntrun: npx grunt- name: Looking for uncommitted changes# Add all files to the git index and then run diff --cached to see all changes.# This ensures that we get the status of all files, including new files.# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.run: |git add .git reset -- npm-shrinkwrap.jsongit diff --cached --exit-codePHPUnit:runs-on: ${{ matrix.os }}services:exttests:image: moodlehq/moodle-exttestsports:- 8080:80redis:image: redisports:- 6379:6379strategy:fail-fast: falsematrix:include:# MySQL builds always run with the lowest PHP supported version.- os: ubuntu-24.04php: 8.2extensions:db: mysqli# PostgreSQL builds always run with the highest PHP supported version.- os: ubuntu-24.04php: 8.4db: pgsqlsteps:- name: Setting up DB mysqlif: ${{ matrix.db == 'mysqli' }}uses: moodlehq/mysql-action@v1with:collation server: utf8mb4_binmysql version: 8.4mysql database: testmysql user: testmysql password: testuse tmpfs: truetmpfs size: '1024M'extra conf: --skip-log-bin- name: Setting up DB pgsqlif: ${{ matrix.db == 'pgsql' }}uses: m4nu56/postgresql-action@v1with:postgresql version: 14postgresql db: testpostgresql user: testpostgresql password: test- name: Configuring git varsuses: rlespinasse/github-slug-action@v4- name: Setting up PHP ${{ matrix.php }}uses: shivammathur/setup-php@v2with:php-version: ${{ matrix.php }}extensions: ${{ matrix.extensions }}ini-values: max_input_vars=5000coverage: none- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}uses: actions/checkout@v4- name: Setting up PHPUnitenv:dbtype: ${{ matrix.db }}run: |echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.cp .github/workflows/config-template.php config.phpmkdir ../moodledatasudo locale-gen en_AU.UTF-8php admin/tool/phpunit/cli/init.php --no-composer-self-update- name: Running PHPUnit testsenv:dbtype: ${{ matrix.db }}phpunit_options: ${{ secrets.phpunit_options }}run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}- name: Git statusrun: git status