| 1 |
efrain |
1 |
name: release branch test
|
|
|
2 |
|
|
|
3 |
on: [push, pull_request]
|
|
|
4 |
|
|
|
5 |
jobs:
|
|
|
6 |
citest:
|
|
|
7 |
name: CI test
|
|
|
8 |
env:
|
|
|
9 |
IGNORE_PATHS: tests/fixtures
|
|
|
10 |
runs-on: 'ubuntu-latest'
|
|
|
11 |
|
|
|
12 |
services:
|
|
|
13 |
postgres:
|
|
|
14 |
image: postgres:13
|
|
|
15 |
env:
|
|
|
16 |
POSTGRES_USER: 'postgres'
|
|
|
17 |
POSTGRES_HOST_AUTH_METHOD: 'trust'
|
|
|
18 |
options: >-
|
|
|
19 |
--health-cmd pg_isready
|
|
|
20 |
--health-interval 10s
|
|
|
21 |
--health-timeout 5s
|
|
|
22 |
--health-retries 3
|
|
|
23 |
ports:
|
|
|
24 |
- 5432:5432
|
|
|
25 |
|
|
|
26 |
mariadb:
|
|
|
27 |
image: mariadb:10.6
|
|
|
28 |
env:
|
|
|
29 |
MYSQL_USER: 'root'
|
|
|
30 |
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
|
|
|
31 |
ports:
|
|
|
32 |
- 3306:3306
|
|
|
33 |
options: >-
|
|
|
34 |
--health-cmd="mysqladmin ping"
|
|
|
35 |
--health-interval 10s
|
|
|
36 |
--health-timeout 5s
|
|
|
37 |
--health-retries 3
|
|
|
38 |
strategy:
|
|
|
39 |
fail-fast: false
|
|
|
40 |
matrix:
|
|
|
41 |
php: ['8.1']
|
|
|
42 |
database: ['mariadb', 'pgsql']
|
|
|
43 |
moodlebranch: ['MOODLE_401_STABLE', 'MOODLE_404_STABLE']
|
|
|
44 |
include:
|
|
|
45 |
- php: '7.4'
|
|
|
46 |
moodlebranch: 'MOODLE_401_STABLE'
|
|
|
47 |
database: 'pgsql'
|
|
|
48 |
- php: '8.2'
|
|
|
49 |
moodlebranch: 'MOODLE_404_STABLE'
|
|
|
50 |
database: 'pgsql'
|
|
|
51 |
|
|
|
52 |
steps:
|
|
|
53 |
- name: Check out repository code
|
|
|
54 |
uses: actions/checkout@v3
|
|
|
55 |
with:
|
|
|
56 |
path: plugin
|
|
|
57 |
|
|
|
58 |
- name: Setup PHP ${{ matrix.php }}
|
|
|
59 |
uses: shivammathur/setup-php@v2
|
|
|
60 |
with:
|
|
|
61 |
php-version: ${{ matrix.php }}
|
|
|
62 |
ini-values: max_input_vars=5000
|
|
|
63 |
coverage: none
|
|
|
64 |
|
|
|
65 |
- name: Initialise moodle-plugin-ci
|
|
|
66 |
run: |
|
|
|
67 |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
|
|
|
68 |
# Add dirs to $PATH
|
|
|
69 |
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
|
|
|
70 |
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
|
|
|
71 |
# PHPUnit depends on en_AU.UTF-8 locale
|
|
|
72 |
sudo locale-gen en_AU.UTF-8
|
|
|
73 |
|
|
|
74 |
- name: Install Moodle
|
|
|
75 |
run: moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1
|
|
|
76 |
env:
|
|
|
77 |
DB: ${{ matrix.database }}
|
|
|
78 |
MOODLE_BRANCH: ${{ matrix.moodlebranch }}
|
|
|
79 |
|
|
|
80 |
- name: Run phplint
|
|
|
81 |
if: ${{ always() }}
|
|
|
82 |
run: moodle-plugin-ci phplint
|
|
|
83 |
|
|
|
84 |
- name: Run codechecker
|
|
|
85 |
if: ${{ always() }}
|
|
|
86 |
run: moodle-plugin-ci codechecker
|
|
|
87 |
|
|
|
88 |
- name: Run validate
|
|
|
89 |
if: ${{ always() }}
|
|
|
90 |
run: moodle-plugin-ci validate
|
|
|
91 |
|
|
|
92 |
- name: Run savepoints
|
|
|
93 |
if: ${{ always() }}
|
|
|
94 |
run: moodle-plugin-ci savepoints
|
|
|
95 |
|
|
|
96 |
- name: Run mustache
|
|
|
97 |
continue-on-error: true # This step will show errors but will not fail
|
|
|
98 |
if: ${{ always() }}
|
|
|
99 |
run: moodle-plugin-ci mustache
|
|
|
100 |
|
|
|
101 |
- name: Run grunt
|
|
|
102 |
continue-on-error: true # This step will show errors but will not fail
|
|
|
103 |
if: ${{ always() }}
|
|
|
104 |
run: moodle-plugin-ci grunt --max-lint-warnings=0
|
|
|
105 |
|
|
|
106 |
- name: Run phpdoc
|
|
|
107 |
continue-on-error: true # This step will show errors but will not fail
|
|
|
108 |
if: ${{ always() }}
|
|
|
109 |
run: moodle-plugin-ci phpdoc
|
|
|
110 |
|
|
|
111 |
- name: Run behat
|
|
|
112 |
if: ${{ always() }}
|
|
|
113 |
run: moodle-plugin-ci behat --profile chrome
|
|
|
114 |
|
|
|
115 |
- name: PHP Copy/Paste Detector
|
|
|
116 |
continue-on-error: true # This step will show errors but will not fail
|
|
|
117 |
if: ${{ always() }}
|
|
|
118 |
run: moodle-plugin-ci phpcpd
|
|
|
119 |
|
|
|
120 |
- name: PHP Mess Detector
|
|
|
121 |
continue-on-error: true # This step will show errors but will not fail
|
|
|
122 |
if: ${{ always() }}
|
|
|
123 |
run: moodle-plugin-ci phpmd
|