@@ -4,7 +4,7 @@ on: [push, pull_request]
44
55jobs :
66 test :
7- runs-on : ubuntu-latest
7+ runs-on : ubuntu-22.04
88
99 services :
1010 postgres :
@@ -15,11 +15,14 @@ jobs:
1515 ports :
1616 - 5432:5432
1717 options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
18+
1819 mariadb :
19- image : mariadb:10.6
20+ image : mariadb:10
2021 env :
2122 MYSQL_USER : ' root'
2223 MYSQL_ALLOW_EMPTY_PASSWORD : " true"
24+ MYSQL_CHARACTER_SET_SERVER : " utf8mb4"
25+ MYSQL_COLLATION_SERVER : " utf8mb4_unicode_ci"
2326 ports :
2427 - 3306:3306
2528 options : --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
9699 php-version : ${{ matrix.php }}
97100 extensions : ${{ matrix.extensions }}
98101 ini-values : max_input_vars=5000
102+ # If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".
103+ # If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).
99104 coverage : none
100105
101106 - name : Initialise moodle-plugin-ci
@@ -107,8 +112,7 @@ jobs:
107112 echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
108113
109114 - name : Install moodle-plugin-ci
110- run : |
111- moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
115+ run : moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
112116 env :
113117 DB : ${{ matrix.database }}
114118 MOODLE_BRANCH : ${{ matrix.moodle-branch }}
@@ -117,42 +121,56 @@ jobs:
117121 PHPDOCCHECKER_IGNORE_PATHS : classes/vendor
118122
119123 - name : PHP Lint
120- if : ${{ always () }}
121- run : moodle-plugin-ci phplint
124+ if : ${{ !cancelled () }}
125+ run : moodle-plugin-ci phplint ./plugin
122126
123127 - name : PHP Mess Detector
124128 continue-on-error : true # This step will show errors but will not fail
125- if : ${{ always () }}
126- run : moodle-plugin-ci phpmd
129+ if : ${{ !cancelled () }}
130+ run : moodle-plugin-ci phpmd ./plugin
127131
128132 - name : Moodle Code Checker
129- if : ${{ always () }}
130- run : moodle-plugin-ci codechecker --max-warnings 0 || true
133+ if : ${{ !cancelled () }}
134+ run : moodle-plugin-ci codechecker --max-warnings 0 ./plugin || true
131135
132136 - name : Moodle PHPDoc Checker
133- if : ${{ always () }}
134- run : moodle-plugin-ci phpdoc || true
137+ if : ${{ !cancelled () }}
138+ run : moodle-plugin-ci phpdoc --max-warnings 0 ./plugin || true
135139
136140 - name : Validating
137- if : ${{ always () }}
138- run : moodle-plugin-ci validate
141+ if : ${{ !cancelled () }}
142+ run : moodle-plugin-ci validate ./plugin
139143
140144 - name : Check upgrade savepoints
141- if : ${{ always () }}
142- run : moodle-plugin-ci savepoints
145+ if : ${{ !cancelled () }}
146+ run : moodle-plugin-ci savepoints ./plugin
143147
144148 - name : Mustache Lint
145- if : ${{ always () }}
146- run : moodle-plugin-ci mustache || true
149+ if : ${{ !cancelled () }}
150+ run : moodle-plugin-ci mustache ./plugin || true
147151
148152 - name : Grunt
149- if : ${{ always () }}
150- run : moodle-plugin-ci grunt || true
153+ if : ${{ !cancelled () }}
154+ run : moodle-plugin-ci grunt ./plugin || true
151155
152156 - name : PHPUnit tests
153- if : ${{ always () }}
154- run : moodle-plugin-ci phpunit --coverage-text || true
157+ if : ${{ !cancelled () }}
158+ run : moodle-plugin-ci phpunit --coverage-text ./plugin || true
155159
156160 - name : Behat features
157- if : ${{ always() }}
158- run : moodle-plugin-ci behat --profile chrome
161+ id : behat
162+ if : ${{ !cancelled() }}
163+ run : moodle-plugin-ci behat --profile chrome ./plugin
164+
165+ - name : Upload Behat Faildump
166+ if : ${{ failure() && steps.behat.outcome == 'failure' }}
167+ uses : actions/upload-artifact@v4
168+ with :
169+ name : Behat Faildump (${{ join(matrix.*, ', ') }})
170+ path : ${{ github.workspace }}/moodledata/behat_dump
171+ retention-days : 7
172+ if-no-files-found : ignore
173+
174+ - name : Mark cancelled jobs as failed.
175+ if : ${{ cancelled() }}
176+ run : exit 1
0 commit comments