File tree 10 files changed +56
-18
lines changed
10 files changed +56
-18
lines changed Original file line number Diff line number Diff line change 13
13
name : PHP_CodeSniffer
14
14
15
15
steps :
16
- - uses : actions/checkout@v3
16
+ - uses : actions/checkout@v4
17
17
18
18
- name : Setup PHP
19
19
uses : shivammathur/setup-php@v2
29
29
run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
30
30
31
31
- name : Cache dependencies
32
- uses : actions/cache@v3
32
+ uses : actions/cache@v4
33
33
with :
34
34
path : ${{ steps.composer-cache.outputs.dir }}
35
35
key : ${{ runner.os }}-composer-${{ hashFiles('tools/phpcs/composer.json') }}
Original file line number Diff line number Diff line change 20
20
name : PHPStan with PHP ${{ matrix.php-versions }} ${{ matrix.prefer }}
21
21
22
22
steps :
23
- - uses : actions/checkout@v3
23
+ - uses : actions/checkout@v4
24
24
25
25
- name : Setup PHP
26
26
uses : shivammathur/setup-php@v2
@@ -35,18 +35,18 @@ jobs:
35
35
run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
36
36
37
37
- name : Cache dependencies
38
- uses : actions/cache@v3
38
+ uses : actions/cache@v4
39
39
with :
40
40
path : ${{ steps.composer-cache.outputs.dir }}
41
41
key : ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.json') }}
42
42
restore-keys : ${{ runner.os }}-composer-${{ matrix.prefer }}-
43
43
44
44
- name : Install dependencies
45
45
run : |
46
- composer update --no-progress --prefer-dist --${{ matrix.prefer }} &&
46
+ composer update --no-progress --prefer-dist --${{ matrix.prefer }} --optimize-autoloader &&
47
47
composer composer-phpunit -- update --no-progress --prefer-dist &&
48
48
composer composer-phpstan -- update --no-progress --prefer-dist --optimize-autoloader &&
49
- composer --working-dir=ci update --no-progress --prefer-dist --${{ matrix.prefer }} --optimize-autoloader -- ignore-platform-req=ext-gd
49
+ composer --working-dir=ci update --no-progress --prefer-dist --${{ matrix.prefer }} --ignore-platform-req=ext-gd
50
50
51
51
- name : Run PHPStan
52
52
run : composer phpstan -- analyse -c phpstan.ci.neon
Original file line number Diff line number Diff line change 7
7
- composer.json
8
8
- tools/phpunit/composer.json
9
9
- phpunit.xml.dist
10
+ - tests/docker-prepare.sh
10
11
11
12
env :
12
13
# On github CI machine creating the "/vendor" volume fails otherwise with: read-only file system: unknown
23
24
CIVICRM_IMAGE_TAG : ${{ matrix.civicrm-image-tags }}
24
25
25
26
steps :
26
- - uses : actions/checkout@v3
27
+ - uses : actions/checkout@v4
27
28
- name : Pull images
28
29
run : docker compose -f tests/docker-compose.yml pull --quiet
29
30
- name : Start containers
Original file line number Diff line number Diff line change 6
6
"civicrm/composer-compile-plugin" : false ,
7
7
"civicrm/composer-downloads-plugin" : true ,
8
8
"cweagans/composer-patches" : true
9
- }
9
+ },
10
+ "sort-packages" : true
10
11
},
11
12
"require" : {
12
13
"civicrm/civicrm-core" : " ^5.54"
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " systopia/de.systopia.civioffice" ,
3
+ "type" : " civicrm-ext" ,
4
+ "license" : " AGPL-3.0-or-later" ,
3
5
"description" : " CiviCRM integration for various exchangeable office suites" ,
4
- "license" : " AGPL-3.0" ,
5
6
"authors" : [
6
7
{
7
- "name" : " SYSTOPIA" ,
8
-
8
+ "name" : " SYSTOPIA GmbH" ,
9
+
10
+ "homepage" : " https://www.systopia.de"
9
11
}
10
12
],
13
+ "minimum-stability" : " dev" ,
14
+ "prefer-stable" : true ,
15
+ "config" : {
16
+ "prepend-autoloader" : false ,
17
+ "sort-packages" : true
18
+ },
11
19
"require" : {
12
20
"beberlei/assert" : " ^3"
13
21
},
33
41
" @php tools/phpcs/vendor/bin/phpcbf"
34
42
],
35
43
"phpstan" : [
36
- " @php tools/phpstan/vendor/bin/phpstan"
44
+ " @php tools/phpstan/vendor/bin/phpstan -v "
37
45
],
38
46
"phpunit" : [
39
47
" @php tools/phpunit/vendor/bin/simple-phpunit --coverage-text"
Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ parameters:
4
4
- Civi
5
5
#- CRM
6
6
- tests
7
+ #- civioffice.php
7
8
excludePaths:
8
9
analyse:
9
- - CRM/* /DAO/*
10
+ - CRM/Civioffice /DAO/*
10
11
- tests/phpunit/bootstrap.php
11
12
scanFiles:
12
13
- civioffice.civix.php
@@ -16,11 +17,12 @@ parameters:
16
17
- tools/phpunit/vendor/bin/.phpunit/phpunit/src/Framework
17
18
bootstrapFiles:
18
19
- tools/phpunit/vendor/bin/.phpunit/phpunit/vendor/autoload.php
19
- - vendor/autoload.php
20
20
- phpstanBootstrap.php
21
21
level: 9
22
22
universalObjectCratesClasses:
23
23
- Civi\Core\Event\GenericHookEvent
24
+ - CRM_Core_Config
25
+ - CRM_Core_DAO
24
26
checkTooWideReturnTypesInProtectedAndPublicMethods: true
25
27
checkUninitializedProperties: true
26
28
checkMissingCallableSignature: true
Original file line number Diff line number Diff line change 41
41
}
42
42
}
43
43
}
44
+
45
+ if (file_exists (__DIR__ . '/vendor/autoload.php ' )) {
46
+ require_once __DIR__ . '/vendor/autoload.php ' ;
47
+ }
Original file line number Diff line number Diff line change 1
- version : " 3"
2
1
services :
3
2
civicrm :
4
- image : michaelmcandrew/civicrm:${CIVICRM_IMAGE_TAG:-5-drupal-php8.1 }
3
+ image : michaelmcandrew/civicrm:${CIVICRM_IMAGE_TAG:-5-drupal}
5
4
environment :
6
5
- PROJECT_NAME=test
7
6
- BASE_URL=http://localhost
@@ -10,6 +9,7 @@ services:
10
9
- CIVICRM_DB_PASS=secret
11
10
- CIVICRM_DB_HOST=mysql
12
11
- CIVICRM_DB_PORT=3306
12
+ - CIVICRM_SITE_KEY=TEST_KEY
13
13
- DRUPAL_DB_NAME=test
14
14
- DRUPAL_DB_USER=root
15
15
- DRUPAL_DB_PASS=secret
Original file line number Diff line number Diff line change @@ -9,6 +9,16 @@ if [ ! -e tools/phpunit/vendor/bin ]; then
9
9
" $SCRIPT_DIR /docker-prepare.sh"
10
10
fi
11
11
12
+ # CIVICRM_SMARTY_AUTOLOAD_PATH is not set in the container's civicrm.settings.php so we have to do it here.
13
+ # Otherwise this results in this error:
14
+ # Fatal error: Cannot declare class Smarty, because the name is already in use in /var/www/html/sites/all/modules/civicrm/packages/smarty5/Smarty.php on line 4
15
+ smarty=$( printf ' %s\n' /var/www/html/sites/all/modules/civicrm/packages/smarty* | sort -r | head -n1)
16
+ if [ -e " $smarty /Smarty.php" ]; then
17
+ export CIVICRM_SMARTY_AUTOLOAD_PATH=" $smarty /Smarty.php"
18
+ elif [ -e " $smarty /vendor/autoload.php" ]; then
19
+ export CIVICRM_SMARTY_AUTOLOAD_PATH=" $smarty /vendor/autoload.php"
20
+ fi
21
+
12
22
export XDEBUG_MODE=coverage
13
23
# TODO: Remove when not needed, anymore.
14
24
# In Docker container with CiviCRM 5.5? all deprecations are reported as direct
Original file line number Diff line number Diff line change 27
27
-i /var/www/html/sites/default/civicrm.settings.php
28
28
civicrm-docker-install
29
29
30
- cv ext:enable " $EXT_NAME "
30
+ # Avoid this error:
31
+ # The autoloader expected class "Civi\ActionSchedule\Mapping" to be defined in
32
+ # file "[...]/Civi/ActionSchedule/Mapping.php". The file was found but the
33
+ # class was not in it, the class name or namespace probably has a typo.
34
+ #
35
+ # Necessary for CiviCRM 5.66.0 - 5.74.x.
36
+ # https://github.com/civicrm/civicrm-core/blob/5.66.0/Civi/ActionSchedule/Mapping.php
37
+ if [ -e /var/www/html/sites/all/modules/civicrm/Civi/ActionSchedule/Mapping.php ] \
38
+ && grep -q ' // Empty file' /var/www/html/sites/all/modules/civicrm/Civi/ActionSchedule/Mapping.php; then
39
+ rm /var/www/html/sites/all/modules/civicrm/Civi/ActionSchedule/Mapping.php
40
+ fi
31
41
32
42
# For headless tests these files need to exist.
33
43
touch /var/www/html/sites/all/modules/civicrm/sql/test_data.mysql
34
44
touch /var/www/html/sites/all/modules/civicrm/sql/test_data_second_domain.mysql
45
+
46
+ cv ext:enable " $EXT_NAME "
35
47
fi
36
48
37
49
cd " $EXT_DIR "
38
- composer update --no-progress --prefer-dist --optimize-autoloader --no-dev
50
+ composer update --no-progress --prefer-dist --optimize-autoloader
39
51
composer composer-phpunit -- update --no-progress --prefer-dist
You can’t perform that action at this time.
0 commit comments