@@ -36,28 +36,27 @@ jobs:
3636 # - each moodle version at least once
3737 # - each database at least once
3838 include :
39- - {php: '7.4', moodle-branch: MOODLE_401_STABLE, database: mariadb}
40- - {php: '8.0', moodle-branch: MOODLE_402_STABLE, database: pgsql}
41- - {php: '8.2', moodle-branch: MOODLE_403_STABLE, database: mariadb}
42- - {php: '8.1', moodle-branch: main, database: pgsql}
39+ - {php: '8.1', moodle-branch: MOODLE_403_STABLE, database: mariadb}
40+ - {php: '8.2', moodle-branch: MOODLE_404_STABLE, database: pgsql}
41+ - {php: '8.2', moodle-branch: main, database: mariadb}
4342
4443 steps :
4544 - name : Check out repository code
46- uses : actions/checkout@v2
45+ uses : actions/checkout@v4
4746 with :
4847 path : plugin
4948
5049 - name : Setup PHP ${{ matrix.php }}
5150 uses : shivammathur/setup-php@v2
5251 with :
5352 php-version : ${{ matrix.php }}
54- extensions : mbstring, pgsql, mysqli
53+ extensions : ${{ matrix.extensions }}
5554 ini-values : max_input_vars=5000
5655 coverage : none
5756
5857 - name : Initialise moodle-plugin-ci
5958 run : |
60- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
59+ composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
6160 echo $(cd ci/bin; pwd) >> $GITHUB_PATH
6261 echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
6362 sudo locale-gen en_AU.UTF-8
@@ -71,47 +70,56 @@ jobs:
7170 MOODLE_BRANCH : ${{ matrix.moodle-branch }}
7271
7372 - name : PHP Lint
74- if : ${{ always () }}
73+ if : ${{ !cancelled () }}
7574 run : moodle-plugin-ci phplint
7675
77- - name : PHP Copy/Paste Detector
78- if : ${{ always() }}
79- continue-on-error : true # This step will show errors but will not fail
80- run : moodle-plugin-ci phpcpd
81-
8276 - name : PHP Mess Detector
83- if : ${{ always () }}
77+ if : ${{ !cancelled () }}
8478 run : moodle-plugin-ci phpmd
8579
8680 - name : Moodle Code Checker
87- if : ${{ always() }}
88- run : moodle-plugin-ci codechecker --max-warnings 0
81+ continue-on-error : true # This step will show errors but will not fail
82+ if : ${{ !cancelled() }}
83+ run : moodle-plugin-ci phpcs --max-warnings 0
8984
9085 - name : Moodle PHPDoc Checker
9186 continue-on-error : true # This step will show errors but will not fail
92- if : ${{ always () }}
93- run : moodle-plugin-ci phpdoc
87+ if : ${{ !cancelled () }}
88+ run : moodle-plugin-ci phpdoc --max-warnings 0
9489
9590 - name : Validating
96- if : ${{ always () }}
91+ if : ${{ !cancelled () }}
9792 run : moodle-plugin-ci validate
9893
9994 - name : Check upgrade savepoints
100- if : ${{ always () }}
95+ if : ${{ !cancelled () }}
10196 run : moodle-plugin-ci savepoints
10297
10398 - name : Mustache Lint
104- if : ${{ always () }}
99+ if : ${{ !cancelled () }}
105100 run : moodle-plugin-ci mustache
106101
107102 - name : Grunt
108- if : ${{ always () }}
103+ if : ${{ !cancelled () }}
109104 run : moodle-plugin-ci grunt --max-lint-warnings 0
110105
111106 - name : PHPUnit tests
112- if : ${{ always () }}
107+ if : ${{ !cancelled () }}
113108 run : moodle-plugin-ci phpunit
114109
115110 - name : Behat features
116- if : ${{ always () }}
111+ if : ${{ !cancelled () }}
117112 run : moodle-plugin-ci behat --profile chrome
113+
114+ - name : Upload Behat Faildump
115+ if : ${{ failure() && steps.behat.outcome == 'failure' }}
116+ uses : actions/upload-artifact@v4
117+ with :
118+ name : Behat Faildump (${{ join(matrix.*, ', ') }})
119+ path : ${{ github.workspace }}/moodledata/behat_dump
120+ retention-days : 7
121+ if-no-files-found : ignore
122+
123+ - name : Mark cancelled jobs as failed.
124+ if : ${{ cancelled() }}
125+ run : exit 1
0 commit comments