1
- name : Moodle Plugin CI checks
1
+ name : Moodle Plugin CI
2
2
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- moodle-plugin-ci :
7
- runs-on : ubuntu-latest
6
+ test :
7
+ runs-on : ubuntu-18.04
8
8
9
9
services :
10
10
postgres :
@@ -18,96 +18,93 @@ jobs:
18
18
19
19
strategy :
20
20
fail-fast : false
21
+ matrix :
22
+ php : ['7.3']
23
+ moodle-branch : ['MOODLE_310_STABLE']
24
+ database : [pgsql]
21
25
22
26
steps :
23
27
- name : Check out repository code
24
28
uses : actions/checkout@v2
25
29
with :
26
30
path : plugin
27
31
28
- - name : Install node
29
- uses : actions/setup-node@v1
30
- with :
31
- node-version : ' 14.15.0'
32
-
33
- - name : Setup PHP environment
32
+ - name : Setup PHP ${{ matrix.php }}
34
33
uses : shivammathur/setup-php@v2
35
34
with :
36
- php-version : ' 7.3'
37
- extensions : mbstring, pgsql
38
- tools : phpunit
35
+ php-version : ${{ matrix.php }}
36
+ coverage : none
39
37
40
- - name : Deploy moodle-plugin-ci
38
+ - name : Initialise moodle-plugin-ci
41
39
run : |
42
40
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
43
41
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
44
42
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
45
43
sudo locale-gen en_AU.UTF-8
44
+ echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
46
45
47
46
- name : Install moodle-plugin-ci
48
- run : moodle-plugin-ci install -vvv --plugin ./plugin
47
+ run : |
48
+ moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
49
49
env :
50
- DB : ' pgsql '
51
- MOODLE_BRANCH : ' MOODLE_310_STABLE '
50
+ DB : ${{ matrix.database }}
51
+ MOODLE_BRANCH : ${{ matrix.moodle-branch }}
52
52
IGNORE_PATHS : ' tests/fixtures/'
53
53
54
- - name : Run phplint
54
+ - name : PHP Lint
55
55
if : ${{ always() }}
56
56
run : moodle-plugin-ci phplint
57
57
58
- - name : Run phpcpd
59
- continue-on-error : true
58
+ - name : PHP Copy/Paste Detector
59
+ continue-on-error : true # This step will show errors but will not fail
60
60
if : ${{ always() }}
61
61
run : moodle-plugin-ci phpcpd
62
62
63
- - name : Run phpmd
64
- continue-on-error : true
63
+ - name : PHP Mess Detector
64
+ continue-on-error : true # This step will show errors but will not fail
65
65
if : ${{ always() }}
66
66
run : moodle-plugin-ci phpmd
67
67
68
- - name : Run codechecker
68
+ - name : Moodle Code Checker
69
69
if : ${{ always() }}
70
70
run : moodle-plugin-ci codechecker --max-warnings 0
71
71
72
- - name : Run validate
73
- # AMOS has its own tables prefixed with 'amos' instead of 'local_amos' for legacy reasons.
74
- continue-on-error : true
72
+ - name : Moodle PHPDoc Checker
73
+ if : ${{ always() }}
74
+ run : moodle-plugin-ci phpdoc
75
+
76
+ - name : Validating
77
+ continue-on-error : true # AMOS has its own tables prefixed with 'amos' instead of 'local_amos' for legacy reasons.
75
78
if : ${{ always() }}
76
79
run : moodle-plugin-ci validate
77
80
78
- - name : Run savepoints
81
+ - name : Check upgrade savepoints
79
82
if : ${{ always() }}
80
83
run : moodle-plugin-ci savepoints
81
84
82
- - name : Run mustache
83
- # Some validation warnings are unavoidable as individual templates may not be fully valid HTML (e.g. table rows).
84
- continue-on-error : true
85
+ - name : Mustache Lint
85
86
if : ${{ always() }}
86
87
run : moodle-plugin-ci mustache
87
88
88
- - name : Run grunt
89
+ - name : Grunt
89
90
if : ${{ always() }}
90
91
run : moodle-plugin-ci grunt --tasks=compile --max-lint-warnings 0
91
92
92
- - name : Run phpdoc
93
- if : ${{ always() }}
94
- run : moodle-plugin-ci phpdoc
95
-
96
- - name : Run AMOS phpunit tests
93
+ - name : PHPUnit tests
97
94
if : ${{ always() }}
98
95
# AMOS runs git as a part of unit tests.
99
96
run : |
100
97
git config --global user.name "Github Runner"
101
98
git config --global user.email "[email protected] "
102
99
moodle-plugin-ci phpunit
103
100
104
- - name : Run related core phpunit tests
101
+ - name : Privacy tests
105
102
if : ${{ always() }}
106
103
run : |
107
104
cd moodle
108
105
vendor/bin/phpunit --fail-on-risky --disallow-test-output -v admin/tool/dataprivacy/tests/metadata_registry_test.php
109
106
vendor/bin/phpunit --fail-on-risky --disallow-test-output -v privacy/tests/provider_test.php
110
107
111
- - name : Run behat
108
+ - name : Behat features
112
109
if : ${{ always() }}
113
110
run : moodle-plugin-ci behat --profile chrome
0 commit comments