This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
76 lines (60 loc) · 1.77 KB
/
.travis.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
language: php
services:
- mysql
cache:
directories:
# backend
- $HOME/.composer/cache/files
- vendor
# frontend
- node_modules
matrix:
fast_finish: true
include:
# next target version
- php: 7.4
env:
- COVERAGE=true
before_install:
# backend
- if [[ $COVERAGE == false ]]; then phpenv config-rm xdebug.ini; fi
- php --version
# frontend
- nvm install v12 # set node version to 12
- node --version
install:
# backend
- composer install --no-scripts
# install local-php-security-checker
- wget -O local-php-security-checker https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64
- chmod +x local-php-security-checker
# frontend
- npm config set "@fortawesome:registry" https://npm.fontawesome.com/
- npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_AUTH_TOKEN
- yarn install
# prepare tests
before_script:
# frontend
- yarn encore production
- yarn encore dev # required for email test to work in unit test
# backend
- php vendor/bin/requirements-checker # check travis image supports symfony application
# execute tests
script:
# backend dependency checks
- composer validate
- ./local-php-security-checker
# backend linters
- if [[ "$COVERAGE" == true ]]; then ./vendor/bin/php-cs-fixer fix --diff --dry-run -v; fi
- php bin/console lint:yaml config
- php bin/console lint:twig templates
# backend tests
- cp .env.travis .env.local
- php bin/console doctrine:database:create --no-interaction
- php bin/console doctrine:migrations:migrate --no-interaction
- php vendor/bin/phpunit
# frontend dependency checks
# - yarn check
- yarn audit --groups dependencies
# frontend linters
- yarn run lint