diff --git a/.github/workflows/moodle-plugin-ci.yml b/.github/workflows/moodle-plugin-ci.yml index 89a57083..f260d223 100644 --- a/.github/workflows/moodle-plugin-ci.yml +++ b/.github/workflows/moodle-plugin-ci.yml @@ -37,13 +37,13 @@ jobs: # - each database at least once include: - {php: '7.4', moodle-branch: MOODLE_401_STABLE, database: mariadb} - - {php: '8.0', moodle-branch: MOODLE_402_STABLE, database: pgsql} - - {php: '8.2', moodle-branch: MOODLE_403_STABLE, database: mariadb} - - {php: '8.1', moodle-branch: main, database: pgsql} + - {php: '8.0', moodle-branch: MOODLE_403_STABLE, database: mariadb} + - {php: '8.1', moodle-branch: MOODLE_404_STABLE, database: pgsql} + - {php: '8.2', moodle-branch: main, database: mariadb} steps: - name: Check out repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: plugin @@ -51,13 +51,13 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: mbstring, pgsql, mysqli + extensions: ${{ matrix.extensions }} ini-values: max_input_vars=5000 coverage: none - name: Initialise moodle-plugin-ci run: | - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 + composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4 echo $(cd ci/bin; pwd) >> $GITHUB_PATH echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH sudo locale-gen en_AU.UTF-8 @@ -71,47 +71,56 @@ jobs: MOODLE_BRANCH: ${{ matrix.moodle-branch }} - name: PHP Lint - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci phplint - - name: PHP Copy/Paste Detector - if: ${{ always() }} - continue-on-error: true # This step will show errors but will not fail - run: moodle-plugin-ci phpcpd - - name: PHP Mess Detector - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci phpmd - name: Moodle Code Checker - if: ${{ always() }} - run: moodle-plugin-ci codechecker --max-warnings 0 + continue-on-error: true # This step will show errors but will not fail + if: ${{ !cancelled() }} + run: moodle-plugin-ci phpcs --max-warnings 0 - name: Moodle PHPDoc Checker continue-on-error: true # This step will show errors but will not fail - if: ${{ always() }} - run: moodle-plugin-ci phpdoc + if: ${{ !cancelled() }} + run: moodle-plugin-ci phpdoc --max-warnings 0 - name: Validating - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci validate - name: Check upgrade savepoints - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci savepoints - name: Mustache Lint - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci mustache - name: Grunt - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci grunt --max-lint-warnings 0 - name: PHPUnit tests - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci phpunit - name: Behat features - if: ${{ always() }} + if: ${{ !cancelled() }} run: moodle-plugin-ci behat --profile chrome + + - name: Upload Behat Faildump + if: ${{ failure() && steps.behat.outcome == 'failure' }} + uses: actions/upload-artifact@v4 + with: + name: Behat Faildump (${{ join(matrix.*, ', ') }}) + path: ${{ github.workspace }}/moodledata/behat_dump + retention-days: 7 + if-no-files-found: ignore + + - name: Mark cancelled jobs as failed. + if: ${{ cancelled() }} + run: exit 1