1
+ name : Moodle plugin CI
2
+ on : [push, pull_request]
3
+
4
+ jobs :
5
+ test :
6
+ runs-on : ' ubuntu-latest'
7
+ strategy :
8
+ fail-fast : false
9
+ matrix :
10
+ include :
11
+ - php : ' 7.2'
12
+ moodle-branch : ' MOODLE_39_STABLE'
13
+ database : ' mariadb'
14
+ node : ' 14.15.0'
15
+ - php : ' 7.2'
16
+ moodle-branch : ' MOODLE_39_STABLE'
17
+ database : ' pgsql'
18
+ node : ' 14.15.0'
19
+
20
+ services :
21
+ postgres :
22
+ image : postgres
23
+ env :
24
+ POSTGRES_USER : ' postgres'
25
+ POSTGRES_HOST_AUTH_METHOD : ' trust'
26
+ options : >-
27
+ --health-cmd pg_isready
28
+ --health-interval 10s
29
+ --health-timeout 5s
30
+ --health-retries 3
31
+ ports :
32
+ - 5432:5432
33
+
34
+ mariadb :
35
+ image : mariadb:10.5
36
+ env :
37
+ MYSQL_USER : ' root'
38
+ MYSQL_ALLOW_EMPTY_PASSWORD : " true"
39
+ ports :
40
+ - 3306:3306
41
+ options : --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
42
+
43
+ steps :
44
+ - name : Checkout
45
+ uses : actions/checkout@v2
46
+ with :
47
+ path : plugin
48
+
49
+ - name : Install node
50
+ uses : actions/setup-node@v1
51
+ with :
52
+ node-version : ${{ matrix.node }}
53
+
54
+ - name : Setup PHP
55
+ uses : shivammathur/setup-php@v2
56
+ with :
57
+ php-version : ${{ matrix.php }}
58
+ extensions : zip, gd, mbstring, pgsql, mysqli
59
+
60
+ - name : Deploy moodle-plugin-ci
61
+ run : |
62
+ composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
63
+ # Add dirs to $PATH
64
+ echo $(cd ci/bin; pwd) >> $GITHUB_PATH
65
+ echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
66
+ # PHPUnit depends on en_AU.UTF-8 locale
67
+ sudo locale-gen en_AU.UTF-8
68
+ - name : Install Moodle
69
+ # Need explicit IP to stop mysql client fail on attempt to use unix socket.
70
+ run : moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
71
+ env :
72
+ DB : ${{ matrix.database }}
73
+ MOODLE_BRANCH : ${{ matrix.moodle-branch }}
74
+ IGNORE_NAMES : ' mobile_*.mustache'
75
+
76
+ - name : phplint
77
+ if : ${{ always() }}
78
+ run : moodle-plugin-ci phplint
79
+
80
+ - name : phpcpd
81
+ if : ${{ always() }}
82
+ run : moodle-plugin-ci phpcpd || true
83
+
84
+ - name : phpmd
85
+ if : ${{ always() }}
86
+ run : moodle-plugin-ci phpmd
87
+
88
+ - name : codechecker
89
+ if : ${{ always() }}
90
+ run : moodle-plugin-ci codechecker
91
+
92
+ - name : validate
93
+ if : ${{ always() }}
94
+ run : moodle-plugin-ci validate
95
+
96
+ - name : savepoints
97
+ if : ${{ always() }}
98
+ run : moodle-plugin-ci savepoints
99
+
100
+ - name : mustache
101
+ if : ${{ always() }}
102
+ run : moodle-plugin-ci mustache
103
+
104
+ - name : grunt
105
+ if : ${{ always() }}
106
+ run : moodle-plugin-ci grunt
107
+
108
+ - name : phpunit
109
+ if : ${{ always() }}
110
+ run : moodle-plugin-ci phpunit
111
+
112
+ - name : behat
113
+ if : ${{ always() }}
114
+ run : moodle-plugin-ci behat --profile chrome
0 commit comments