@@ -4,7 +4,7 @@ on: [push, pull_request]
4
4
5
5
jobs :
6
6
test :
7
- runs-on : ubuntu-latest
7
+ runs-on : ubuntu-22.04
8
8
9
9
services :
10
10
postgres :
@@ -15,11 +15,14 @@ jobs:
15
15
ports :
16
16
- 5432:5432
17
17
options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
18
+
18
19
mariadb :
19
- image : mariadb:10.6
20
+ image : mariadb:10
20
21
env :
21
22
MYSQL_USER : ' root'
22
23
MYSQL_ALLOW_EMPTY_PASSWORD : " true"
24
+ MYSQL_CHARACTER_SET_SERVER : " utf8mb4"
25
+ MYSQL_COLLATION_SERVER : " utf8mb4_unicode_ci"
23
26
ports :
24
27
- 3306:3306
25
28
options : --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
96
99
php-version : ${{ matrix.php }}
97
100
extensions : ${{ matrix.extensions }}
98
101
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).
99
104
coverage : none
100
105
101
106
- name : Initialise moodle-plugin-ci
@@ -107,8 +112,7 @@ jobs:
107
112
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
108
113
109
114
- 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
112
116
env :
113
117
DB : ${{ matrix.database }}
114
118
MOODLE_BRANCH : ${{ matrix.moodle-branch }}
@@ -117,42 +121,56 @@ jobs:
117
121
PHPDOCCHECKER_IGNORE_PATHS : classes/vendor
118
122
119
123
- name : PHP Lint
120
- if : ${{ always () }}
121
- run : moodle-plugin-ci phplint
124
+ if : ${{ !cancelled () }}
125
+ run : moodle-plugin-ci phplint ./plugin
122
126
123
127
- name : PHP Mess Detector
124
128
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
127
131
128
132
- 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
131
135
132
136
- 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
135
139
136
140
- name : Validating
137
- if : ${{ always () }}
138
- run : moodle-plugin-ci validate
141
+ if : ${{ !cancelled () }}
142
+ run : moodle-plugin-ci validate ./plugin
139
143
140
144
- name : Check upgrade savepoints
141
- if : ${{ always () }}
142
- run : moodle-plugin-ci savepoints
145
+ if : ${{ !cancelled () }}
146
+ run : moodle-plugin-ci savepoints ./plugin
143
147
144
148
- name : Mustache Lint
145
- if : ${{ always () }}
146
- run : moodle-plugin-ci mustache || true
149
+ if : ${{ !cancelled () }}
150
+ run : moodle-plugin-ci mustache ./plugin || true
147
151
148
152
- name : Grunt
149
- if : ${{ always () }}
150
- run : moodle-plugin-ci grunt || true
153
+ if : ${{ !cancelled () }}
154
+ run : moodle-plugin-ci grunt ./plugin || true
151
155
152
156
- 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
155
159
156
160
- 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