-
Notifications
You must be signed in to change notification settings - Fork 38
92 lines (83 loc) · 2.8 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Integration & Unit test
on:
pull_request:
branches:
- master
- MOODLE_41_STABLE
env:
php: 8.2
jobs:
PHPUnit:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
## Moodle 4.1+ with PHP 8.1
- os: ubuntu-22.04
php: 8.1
db: mysqli
moodle: MOODLE_401_STABLE
experimental: true
## Moodle 4.2+ with PHP 8.2
- os: ubuntu-22.04
php: 8.2
db: mysqli
moodle: MOODLE_402_STABLE
experimental: true
## Moodle 4.3+ with PHP 8.2
- os: ubuntu-22.04
php: 8.2
db: mysqli
moodle: MOODLE_403_STABLE
experimental: true
# Future supported versions
## Moodle development version with PHP 8.2
- os: ubuntu-22.04
php: 8.2
db: mysqli
moodle: master
experimental: true
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
with:
collation server: utf8mb4_unicode_ci
mysql version: 8.0
mysql database: test
mysql user: test
mysql password: test
use tmpfs: true
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
ini-values: 'max_input_vars=5000'
- name: Checking out code from moodle/moodle
uses: actions/checkout@v4
with:
repository: moodle/moodle
ref: ${{ matrix.moodle }}
- name: Check out code from ${{ github.repository }}
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/blocks/sharing_cart
ref: ${{ github.ref }}
- name: Lint module code
run:
find $GITHUB_WORKSPACE/blocks/sharing_cart -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp $GITHUB_WORKSPACE/.github/workflows/config-template.php $GITHUB_WORKSPACE/config.php
mkdir $GITHUB_WORKSPACE/../moodledata
sudo locale-gen en_AU.UTF-8
php $GITHUB_WORKSPACE/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
run: $GITHUB_WORKSPACE/vendor/bin/phpunit -c $GITHUB_WORKSPACE/phpunit.xml --testsuite=block_sharing_cart_testsuite -v --testdox