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:include:- php: '8.0'moodle-branch: 'MOODLE_311_STABLE'database: 'pgsql'- php: '7.3'moodle-branch: 'MOODLE_311_STABLE'database: 'mariadb'- php: '8.0'moodle-branch: 'MOODLE_400_STABLE'database: 'mariadb'- php: '7.3'moodle-branch: 'MOODLE_400_STABLE'database: 'pgsql'- php: '8.1'moodle-branch: 'MOODLE_401_STABLE'database: 'pgsql'- php: '7.4'moodle-branch: 'MOODLE_401_STABLE'database: 'mariadb'- php: '8.2'moodle-branch: 'MOODLE_402_STABLE'database: 'mariadb'- php: '8.0'moodle-branch: 'MOODLE_402_STABLE'database: 'pgsql'- php: '8.2'moodle-branch: 'MOODLE_403_STABLE'database: 'pgsql'- php: '8.0'moodle-branch: 'MOODLE_403_STABLE'database: 'mariadb'- php: '8.3'# Main job. Run all checks that do not require setup and only need to be run once.runchecks: 'all'moodle-branch: 'MOODLE_404_STABLE'database: 'mariadb'- php: '8.1'moodle-branch: 'MOODLE_404_STABLE'database: 'pgsql'steps:- 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: |civersion=$(if [[ "${{ matrix.php }}" =~ ^7.[23]$ ]]; then echo "^3"; fi)composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ${civersion:-^4}echo $(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() && matrix.runchecks == 'all' }}run: moodle-plugin-ci phplint- name: PHP Mess Detectorcontinue-on-error: true # This step will show errors but will not failif: ${{ !cancelled() && matrix.runchecks == 'all' }}run: moodle-plugin-ci phpmd- name: Moodle Code Checkerif: ${{ !cancelled() && matrix.runchecks == 'all' }}run: moodle-plugin-ci phpcs --max-warnings 0- name: Moodle PHPDoc Checkerif: ${{ !cancelled() && matrix.runchecks == 'all' }}run: moodle-plugin-ci phpdoc --max-warnings 0- name: Validatingif: ${{ !cancelled() }}run: moodle-plugin-ci validate- name: Check upgrade savepointsif: ${{ !cancelled() && matrix.runchecks == 'all' }}run: moodle-plugin-ci savepoints- name: Mustache Lintif: ${{ !cancelled() && matrix.runchecks == 'all' }}run: moodle-plugin-ci mustache- name: Gruntif: ${{ !cancelled() && matrix.runchecks == 'all' }}run: moodle-plugin-ci grunt --max-lint-warnings 0- name: PHPUnit testsif: ${{ !cancelled() }}run: moodle-plugin-ci phpunit --fail-on-warning- name: Behat featuresid: behatif: ${{ !cancelled() }}run: moodle-plugin-ci behat --profile chrome- name: Upload Behat Faildumpif: ${{ failure() && steps.behat.outcome == 'failure' }}uses: actions/upload-artifact@v4with:name: Behat Faildump (${{ join(matrix.*, ', ') }})path: ${{ github.workspace }}/moodledata/behat_dumpretention-days: 7if-no-files-found: ignore- name: Mark cancelled jobs as failed.if: ${{ cancelled() }}run: exit 1