]> git.p6c8.net - jirafeau_project.git/blob - .gitlab-ci.yml
[TASK] update CI to add PHP 8.1
[jirafeau_project.git] / .gitlab-ci.yml
1 # Select docker image from https://hub.docker.com/_/php/
2 image: php:8.1
3
4 # Select what we should cache
5 cache:
6 paths:
7 - vendor/
8
9 before_script:
10 # Install git, the docker php image doesn't have it installed by default
11 - apt-get update -yqq
12 - apt-get install git -yqq
13 - apt-get install zip -yqq
14 # Enable necessary php extensions
15 - docker-php-ext-enable curl && docker-php-ext-enable json && docker-php-ext-enable zip && docker-php-ext-enable mbstring && docker-php-ext-enable gd && docker-php-ext-enable pdo_mysql
16 # Install composer
17 - curl -sS https://getcomposer.org/installer | php
18 # Create composer.json file manually, since this is a project without any non-dev dependencies yet
19 - php composer.phar require --dev php-parallel-lint/php-parallel-lint
20 - php composer.phar require --dev friendsofphp/php-cs-fixer
21 # Install all project dependencies
22 - php composer.phar install
23
24 # Run tests
25 test_app_phpdefaultversion:
26 script:
27 - ./vendor/bin/parallel-lint --exclude vendor .
28 - ./vendor/bin/php-cs-fixer -vvv fix . --dry-run --diff --using-cache=no --rules=@PSR2
29
30 test_app_php81:
31 image: php:8.1
32 script:
33 - ./vendor/bin/parallel-lint --exclude vendor .
34 - ./vendor/bin/php-cs-fixer -vvv fix . --dry-run --diff --using-cache=no --rules=@PSR2
35 allow_failure: true
36
37 test_app_php73:
38 image: php:7.3
39 script:
40 - ./vendor/bin/parallel-lint --exclude vendor .
41 - ./vendor/bin/php-cs-fixer -vvv fix . --dry-run --diff --using-cache=no --rules=@PSR2
42 allow_failure: true
43
44 # Run same tests with older supported versions
45 test_app_php72:
46 image: php:7.2
47 script:
48 - ./vendor/bin/parallel-lint --exclude vendor .
49 - ./vendor/bin/php-cs-fixer -vvv fix . --dry-run --diff --using-cache=no --rules=@PSR2
50
51 test_app_php71:
52 image: php:7.1
53 script:
54 - ./vendor/bin/parallel-lint --exclude vendor .
55 - ./vendor/bin/php-cs-fixer -vvv fix . --dry-run --diff --using-cache=no --rules=@PSR2
56
57 test_app_php70:
58 image: php:7.0
59 script:
60 - ./vendor/bin/parallel-lint --exclude vendor .
61 - ./vendor/bin/php-cs-fixer -vvv fix . --dry-run --diff --using-cache=no --rules=@PSR2
62
63 test_app_php56:
64 image: php:5.6
65 script:
66 - ./vendor/bin/parallel-lint --exclude vendor .
67 - ./vendor/bin/php-cs-fixer -vvv fix . --dry-run --diff --using-cache=no --rules=@PSR2

patrick-canterino.de