AutorÃa | Ultima modificación | Ver Log |
name: Moodle Plugin CIon: [push, pull_request]jobs:test:runs-on: ubuntu-22.04services:postgres:image: postgres:13env:POSTGRES_USER: 'postgres'POSTGRES_HOST_AUTH_METHOD: 'trust'ports:- 5432:5432options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3mariadb:image: mariadb:10env:MYSQL_USER: 'root'MYSQL_ALLOW_EMPTY_PASSWORD: "true"MYSQL_CHARACTER_SET_SERVER: "utf8mb4"MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"ports:- 3306:3306options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3strategy:fail-fast: falsematrix:php: ['7.4', '8.0', '8.1', '8.2']moodle-branch: [MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE]database: [pgsql, mariadb]# See: https://moodledev.io/general/development/policies/phpexclude:- php: '7.4'moodle-branch: MOODLE_402_STABLE- php: '7.4'moodle-branch: MOODLE_403_STABLE- php: '8.0'moodle-branch: MOODLE_403_STABLE- php: '8.2'moodle-branch: MOODLE_401_STABLEsteps:- name: Check out repository codeuses: actions/checkout@v4with:path: plugin- name: Setup PHP ${{ matrix.php }}uses: shivammathur/setup-php@v2with:php-version: ${{ matrix.php }}extensions: ${{ matrix.extensions }}ini-values: max_input_vars=5000# If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".# If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).coverage: none- name: Initialise moodle-plugin-cirun: |composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4echo $(cd ci/bin; pwd) >> $GITHUB_PATHecho $(cd ci/vendor/bin; pwd) >> $GITHUB_PATHsudo locale-gen en_AU.UTF-8echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV- name: Install moodle-plugin-cirun: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1env:DB: ${{ matrix.database }}MOODLE_BRANCH: ${{ matrix.moodle-branch }}# Uncomment this to run Behat tests using the Moodle App.# MOODLE_APP: 'true'- name: PHP Lintif: ${{ !cancelled() }}run: moodle-plugin-ci phplint- name: PHP Copy/Paste Detectorcontinue-on-error: true # This step will show errors but will not failif: ${{ !cancelled() }}run: moodle-plugin-ci phpcpd- name: PHP Mess Detectorcontinue-on-error: true # This step will show errors but will not failif: ${{ !cancelled() }}run: moodle-plugin-ci phpmd- name: Moodle Code Checkerif: ${{ !cancelled() }}run: moodle-plugin-ci phpcs --max-warnings 0- name: Moodle PHPDoc Checkerif: ${{ !cancelled() }}run: moodle-plugin-ci phpdoc --max-warnings 0- name: Validatingif: ${{ !cancelled() }}run: moodle-plugin-ci validate- name: Check upgrade savepointsif: ${{ !cancelled() }}run: moodle-plugin-ci savepoints- name: Mustache Lintif: ${{ !cancelled() }}run: moodle-plugin-ci mustache- name: Gruntif: ${{ !cancelled() }}run: moodle-plugin-ci grunt --max-lint-warnings 0- name: PHPUnit testsif: ${{ !cancelled() }}run: moodle-plugin-ci phpunit --fail-on-warning- name: Behat featuresif: ${{ !cancelled() }}run: moodle-plugin-ci behat --profile chrome- name: Mark cancelled jobs as failed.if: ${{ cancelled() }}run: exit 1