@@ -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
@@ -104,11 +109,11 @@ jobs:
104
109
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
105
110
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
106
111
sudo locale-gen en_AU.UTF-8
107
- echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
112
+ # echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
113
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
108
114
109
115
- name : Install moodle-plugin-ci
110
- run : |
111
- moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
116
+ run : moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
112
117
env :
113
118
DB : ${{ matrix.database }}
114
119
MOODLE_BRANCH : ${{ matrix.moodle-branch }}
@@ -117,42 +122,56 @@ jobs:
117
122
PHPDOCCHECKER_IGNORE_PATHS : classes/vendor
118
123
119
124
- name : PHP Lint
120
- if : ${{ always () }}
121
- run : moodle-plugin-ci phplint
125
+ if : ${{ !cancelled () }}
126
+ run : moodle-plugin-ci phplint ./plugin
122
127
123
128
- name : PHP Mess Detector
124
129
continue-on-error : true # This step will show errors but will not fail
125
- if : ${{ always () }}
126
- run : moodle-plugin-ci phpmd
130
+ if : ${{ !cancelled () }}
131
+ run : moodle-plugin-ci phpmd ./plugin
127
132
128
133
- name : Moodle Code Checker
129
- if : ${{ always () }}
130
- run : moodle-plugin-ci codechecker --max-warnings 0 || true
134
+ if : ${{ !cancelled () }}
135
+ run : moodle-plugin-ci codechecker --max-warnings 0 ./plugin || true
131
136
132
137
- name : Moodle PHPDoc Checker
133
- if : ${{ always () }}
134
- run : moodle-plugin-ci phpdoc || true
138
+ if : ${{ !cancelled () }}
139
+ run : moodle-plugin-ci phpdoc --max-warnings 0 ./plugin || true
135
140
136
141
- name : Validating
137
- if : ${{ always () }}
138
- run : moodle-plugin-ci validate
142
+ if : ${{ !cancelled () }}
143
+ run : moodle-plugin-ci validate ./plugin
139
144
140
145
- name : Check upgrade savepoints
141
- if : ${{ always () }}
142
- run : moodle-plugin-ci savepoints
146
+ if : ${{ !cancelled () }}
147
+ run : moodle-plugin-ci savepoints ./plugin
143
148
144
149
- name : Mustache Lint
145
- if : ${{ always () }}
146
- run : moodle-plugin-ci mustache || true
150
+ if : ${{ !cancelled () }}
151
+ run : moodle-plugin-ci mustache ./plugin || true
147
152
148
153
- name : Grunt
149
- if : ${{ always () }}
150
- run : moodle-plugin-ci grunt || true
154
+ if : ${{ !cancelled () }}
155
+ run : moodle-plugin-ci grunt ./plugin || true
151
156
152
157
- name : PHPUnit tests
153
- if : ${{ always () }}
154
- run : moodle-plugin-ci phpunit --coverage-text || true
158
+ if : ${{ !cancelled () }}
159
+ run : moodle-plugin-ci phpunit --coverage-text ./plugin || true
155
160
156
161
- name : Behat features
157
- if : ${{ always() }}
158
- run : moodle-plugin-ci behat --profile chrome
162
+ id : behat
163
+ if : ${{ !cancelled() }}
164
+ run : moodle-plugin-ci behat --profile chrome ./plugin
165
+
166
+ - name : Upload Behat Faildump
167
+ if : ${{ failure() && steps.behat.outcome == 'failure' }}
168
+ uses : actions/upload-artifact@v4
169
+ with :
170
+ name : Behat Faildump (${{ join(matrix.*, ', ') }})
171
+ path : ${{ github.workspace }}/moodledata/behat_dump
172
+ retention-days : 7
173
+ if-no-files-found : ignore
174
+
175
+ - name : Mark cancelled jobs as failed.
176
+ if : ${{ cancelled() }}
177
+ run : exit 1
0 commit comments