Skip to content

Commit cb25b3b

Browse files
committed
Merge branch 'WP-5390' into 'MOODLE_500_STABLE'
WP-5390 initial changes for 5.0 See merge request workplace/moodle-tool_certificate!216
2 parents 362b60f + b09286f commit cb25b3b

File tree

23 files changed

+126
-271
lines changed

23 files changed

+126
-271
lines changed

.github/workflows/moodle-ci.yml

Lines changed: 43 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ jobs:
88

99
services:
1010
postgres:
11-
image: postgres:13
11+
image: postgres:14
1212
env:
1313
POSTGRES_USER: 'postgres'
1414
POSTGRES_HOST_AUTH_METHOD: 'trust'
1515
ports:
1616
- 5432:5432
1717
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
18+
1819
mariadb:
1920
image: mariadb:10
2021
env:
2122
MYSQL_USER: 'root'
2223
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
24+
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
25+
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
2326
ports:
2427
- 3306:3306
2528
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
@@ -28,37 +31,18 @@ jobs:
2831
fail-fast: false
2932
matrix:
3033
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'
4739
- 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'
5842

5943
steps:
6044
- name: Check out repository code
61-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
6246
with:
6347
path: plugin
6448

@@ -68,6 +52,8 @@ jobs:
6852
php-version: ${{ matrix.php }}
6953
extensions: ${{ matrix.extensions }}
7054
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).
7157
coverage: none
7258

7359
- name: Initialise moodle-plugin-ci
@@ -83,54 +69,60 @@ jobs:
8369
env:
8470
DB: ${{ matrix.database }}
8571
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
72+
# Uncomment this to run Behat tests using the Moodle App.
73+
# MOODLE_APP: 'true'
8674

8775
- name: PHP Lint
88-
if: ${{ always() }}
76+
if: ${{ !cancelled() && matrix.runchecks == 'all' }}
8977
run: moodle-plugin-ci phplint
9078

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-
9679
- name: PHP Mess Detector
9780
continue-on-error: true # This step will show errors but will not fail
98-
if: ${{ always() }}
81+
if: ${{ !cancelled() && matrix.runchecks == 'all' }}
9982
run: moodle-plugin-ci phpmd
10083

10184
- 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
10487

10588
- name: Moodle PHPDoc Checker
106-
if: ${{ always() }}
89+
if: ${{ !cancelled() && matrix.runchecks == 'all' }}
10790
run: moodle-plugin-ci phpdoc --max-warnings 0
10891

10992
- name: Validating
110-
if: ${{ always() }}
93+
if: ${{ !cancelled() }}
11194
run: moodle-plugin-ci validate
11295

11396
- name: Check upgrade savepoints
114-
if: ${{ always() }}
97+
if: ${{ !cancelled() && matrix.runchecks == 'all' }}
11598
run: moodle-plugin-ci savepoints
11699

117100
- name: Mustache Lint
118-
if: ${{ always() }}
101+
if: ${{ !cancelled() && matrix.runchecks == 'all' }}
119102
run: moodle-plugin-ci mustache
120103

121104
- name: Grunt
122-
if: ${{ always() }}
105+
if: ${{ !cancelled() && matrix.runchecks == 'all' }}
123106
run: moodle-plugin-ci grunt --max-lint-warnings 0
124107

125108
- 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
133111

134112
- 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

Comments
 (0)