Skip to content

Commit 31d6c69

Browse files
Update CI workflow
1 parent 17a13cc commit 31d6c69

File tree

1 file changed

+42
-28
lines changed

1 file changed

+42
-28
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ jobs:
88
fail-fast: false
99
matrix:
1010
include:
11-
- php: '7.4'
12-
moodle-branch: 'master'
11+
- php: '8.3'
12+
moodle-branch: 'main'
1313
database: 'pgsql'
14-
- php: '7.4'
15-
moodle-branch: 'MOODLE_311_STABLE'
14+
- php: '8.3'
15+
moodle-branch: 'MOODLE_500_STABLE'
16+
database: 'mariadb'
17+
- php: '8.2'
18+
moodle-branch: 'MOODLE_405_STABLE'
19+
database: 'pgsql'
20+
- php: '8.2'
21+
moodle-branch: 'MOODLE_404_STABLE'
1622
database: 'mariadb'
1723

1824
services:
1925
postgres:
20-
image: postgres
26+
image: postgres:14
2127
env:
2228
POSTGRES_USER: 'postgres'
2329
POSTGRES_HOST_AUTH_METHOD: 'trust'
@@ -30,77 +36,85 @@ jobs:
3036
- 5432:5432
3137

3238
mariadb:
33-
image: mariadb
39+
image: mariadb:10
3440
env:
3541
MYSQL_USER: 'root'
3642
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
43+
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
44+
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
3745
ports:
3846
- 3306:3306
3947
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
4048

4149
steps:
42-
- name: Checkout
50+
- name: Checkout repository code
4351
uses: actions/checkout@v2
4452
with:
4553
path: plugin
4654

47-
- name: Setup PHP
55+
- name: Setup PHP ${{ matrix.php }}
4856
uses: shivammathur/setup-php@v2
4957
with:
5058
php-version: ${{ matrix.php }}
51-
extensions: mbstring, pgsql, mysqli
59+
extensions: ${{ matrix.extensions }}
60+
ini-values: max_input_vars=5000
61+
coverage: none
5262

53-
- name: Deploy moodle-plugin-ci
63+
- name: Initialise moodle-plugin-ci
5464
run: |
55-
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
56-
# Add dirs to $PATH
65+
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
5766
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
5867
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
59-
# PHPUnit depends on en_AU.UTF-8 locale
6068
sudo locale-gen en_AU.UTF-8
69+
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
6170
6271
- name: Install Moodle
6372
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
6473
env:
6574
DB: ${{ matrix.database }}
6675
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
6776

68-
- name: phplint
77+
- name: PHP Lint
6978
if: ${{ always() }}
7079
run: moodle-plugin-ci phplint
7180

72-
- name: phpcpd
81+
- name: PHP Copy/Paste Detector
82+
continue-on-error: true # This step will show errors but will not fail.
7383
if: ${{ always() }}
74-
run: moodle-plugin-ci phpcpd || true
84+
run: moodle-plugin-ci phpcpd
7585

76-
- name: phpmd
86+
- name: PHP Mess Detector
7787
if: ${{ always() }}
7888
run: moodle-plugin-ci phpmd
7989

80-
- name: codechecker
90+
- name: Moodle Code Checker
8191
if: ${{ always() }}
82-
run: moodle-plugin-ci codechecker
92+
run: moodle-plugin-ci codechecker --max-warnings 0
8393

84-
- name: validate
94+
- name: Moodle PHPDoc Checker
95+
if: ${{ always() }}
96+
run: moodle-plugin-ci phpdoc
97+
98+
- name: Validating
8599
if: ${{ always() }}
86100
run: moodle-plugin-ci validate
87101

88-
- name: savepoints
102+
- name: Check upgrade savepoints
89103
if: ${{ always() }}
90104
run: moodle-plugin-ci savepoints
91105

92-
- name: mustache
106+
- name: Mustache Lint
107+
continue-on-error: true # We are getting a false positive due to MDLSITE-6744 so ignore.
93108
if: ${{ always() }}
94109
run: moodle-plugin-ci mustache
95110

96-
- name: grunt
97-
if: ${{ always() }}
98-
run: moodle-plugin-ci grunt
111+
- name: Grunt
112+
run: moodle-plugin-ci grunt --max-lint-warnings 4
99113

100-
- name: phpunit
114+
- name: PHPUnit tests
101115
if: ${{ always() }}
102-
run: moodle-plugin-ci phpunit
116+
run: moodle-plugin-ci phpunit --fail-on-warning
103117

104-
- name: behat
118+
- name: Behat features
105119
if: ${{ always() }}
106120
run: moodle-plugin-ci behat --profile chrome

0 commit comments

Comments
 (0)