8
8
9
9
services :
10
10
postgres :
11
- image : postgres:13
11
+ image : postgres:14
12
12
env :
13
13
POSTGRES_USER : ' postgres'
14
14
POSTGRES_HOST_AUTH_METHOD : ' trust'
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
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
@@ -28,37 +31,18 @@ jobs:
28
31
fail-fast : false
29
32
matrix :
30
33
include :
31
- - php : ' 8.0'
32
- moodle-branch : ' MOODLE_400_STABLE'
33
- database : mariadb
34
- extensions : xmlrpc-beta
35
- - php : ' 7.4'
36
- moodle-branch : ' MOODLE_401_STABLE'
37
- database : pgsql
38
- - php : ' 8.1'
39
- moodle-branch : ' MOODLE_401_STABLE'
40
- database : mariadb
41
- - php : ' 8.0'
42
- moodle-branch : ' MOODLE_402_STABLE'
43
- database : mariadb
44
- - php : ' 8.1'
45
- moodle-branch : ' MOODLE_402_STABLE'
46
- database : pgsql
34
+ - php : ' 8.4'
35
+ # Main job. Run all checks that do not require setup and only need to be run once.
36
+ runchecks : ' all'
37
+ moodle-branch : ' main' # TODO change to MOODLE_500_STABLE
38
+ database : ' pgsql'
47
39
- php : ' 8.2'
48
- moodle-branch : ' MOODLE_403_STABLE'
49
- database : pgsql
50
- - php : ' 8.3'
51
- moodle-branch : ' MOODLE_404_STABLE'
52
- database : pgsql
53
- extensions : xmlrpc-beta
54
- - php : ' 8.3'
55
- moodle-branch : ' MOODLE_405_STABLE'
56
- database : pgsql
57
- extensions : xmlrpc-beta
40
+ moodle-branch : ' main' # TODO change to MOODLE_500_STABLE
41
+ database : ' mariadb'
58
42
59
43
steps :
60
44
- name : Check out repository code
61
- uses : actions/checkout@v3
45
+ uses : actions/checkout@v4
62
46
with :
63
47
path : plugin
64
48
68
52
php-version : ${{ matrix.php }}
69
53
extensions : ${{ matrix.extensions }}
70
54
ini-values : max_input_vars=5000
55
+ # If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".
56
+ # If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).
71
57
coverage : none
72
58
73
59
- name : Initialise moodle-plugin-ci
@@ -83,54 +69,60 @@ jobs:
83
69
env :
84
70
DB : ${{ matrix.database }}
85
71
MOODLE_BRANCH : ${{ matrix.moodle-branch }}
72
+ # Uncomment this to run Behat tests using the Moodle App.
73
+ # MOODLE_APP: 'true'
86
74
87
75
- name : PHP Lint
88
- if : ${{ always() }}
76
+ if : ${{ !cancelled() && matrix.runchecks == 'all' }}
89
77
run : moodle-plugin-ci phplint
90
78
91
- - name : PHP Copy/Paste Detector
92
- continue-on-error : true # This step will show errors but will not fail
93
- if : ${{ always() }}
94
- run : moodle-plugin-ci phpcpd
95
-
96
79
- name : PHP Mess Detector
97
80
continue-on-error : true # This step will show errors but will not fail
98
- if : ${{ always() }}
81
+ if : ${{ !cancelled() && matrix.runchecks == 'all' }}
99
82
run : moodle-plugin-ci phpmd
100
83
101
84
- name : Moodle Code Checker
102
- if : ${{ always() }}
103
- run : moodle-plugin-ci codechecker --max-warnings 0
85
+ if : ${{ !cancelled() && matrix.runchecks == 'all' }}
86
+ run : moodle-plugin-ci phpcs --max-warnings 0
104
87
105
88
- name : Moodle PHPDoc Checker
106
- if : ${{ always() }}
89
+ if : ${{ !cancelled() && matrix.runchecks == 'all' }}
107
90
run : moodle-plugin-ci phpdoc --max-warnings 0
108
91
109
92
- name : Validating
110
- if : ${{ always () }}
93
+ if : ${{ !cancelled () }}
111
94
run : moodle-plugin-ci validate
112
95
113
96
- name : Check upgrade savepoints
114
- if : ${{ always() }}
97
+ if : ${{ !cancelled() && matrix.runchecks == 'all' }}
115
98
run : moodle-plugin-ci savepoints
116
99
117
100
- name : Mustache Lint
118
- if : ${{ always() }}
101
+ if : ${{ !cancelled() && matrix.runchecks == 'all' }}
119
102
run : moodle-plugin-ci mustache
120
103
121
104
- name : Grunt
122
- if : ${{ always() }}
105
+ if : ${{ !cancelled() && matrix.runchecks == 'all' }}
123
106
run : moodle-plugin-ci grunt --max-lint-warnings 0
124
107
125
108
- name : PHPUnit tests
126
- if : ${{ always() }}
127
- run : |
128
- moodle-plugin-ci phpunit
129
- cd moodle
130
- vendor/bin/phpunit --fail-on-risky --disallow-test-output --testsuite tool_dataprivacy_testsuite --filter metadata_registry_test
131
- vendor/bin/phpunit --fail-on-risky --disallow-test-output --filter "test_all_external_info@tool_certificate.*"
132
- vendor/bin/phpunit --fail-on-risky --disallow-test-output --testsuite core_privacy_testsuite --filter provider_test
109
+ if : ${{ !cancelled() }}
110
+ run : moodle-plugin-ci phpunit --fail-on-warning
133
111
134
112
- name : Behat features
135
- if : ${{ always() }}
136
- run : moodle-plugin-ci behat --profile chrome
113
+ id : behat
114
+ if : ${{ !cancelled() }}
115
+ run : moodle-plugin-ci behat --profile chrome --scss-deprecations
116
+
117
+ - name : Upload Behat Faildump
118
+ if : ${{ failure() && steps.behat.outcome == 'failure' }}
119
+ uses : actions/upload-artifact@v4
120
+ with :
121
+ name : Behat Faildump (${{ join(matrix.*, ', ') }})
122
+ path : ${{ github.workspace }}/moodledata/behat_dump
123
+ retention-days : 7
124
+ if-no-files-found : ignore
125
+
126
+ - name : Mark cancelled jobs as failed.
127
+ if : ${{ cancelled() }}
128
+ run : exit 1
0 commit comments