generated from biurad/php-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
55 lines (47 loc) · 2.33 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
# Ensure that PHP is installed in Travis' build environment. Travis provides several versions of
# PHP like 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, etc., each of them including XDebug and PHPUnit.
language: php
# Travis can cache content between builds. This speeds up the build process and saves resources.
cache:
directories:
# Cache composer packages so "composer install" is faster.
- $HOME/.composer/cache/files
env:
global:
- ACTION="install"
- BIURAD_CONSOLE="no"
# Defines all jobs which Travis will run in parallel. For each PHP version we support we will run one job.
jobs:
# With fast finishing enabled, Travis CI will mark your build as finished as soon as one of two
# conditions are met: The only remaining jobs are allowed to fail, or a job has already failed. In
# these cases, the status of the build can already be determined, so there’s no need to wait around
# until the other jobs finish.
fast_finish: true
# Allow fail on 7.2 and 8 so we can fix issues found
allow_failures:
- php: nightly
include:
# Run tests with the dependencies from composer.lock
- php: 8.0
- php: nightly
before_install:
- composer selfupdate
# Create a new ".env" file, if doesn't exits.
- php -r "file_exists('.env') || copy('env.example', '.env');"
- phpenv config-rm xdebug.ini || true
# Change minimum-stability to allow upcoming versions (dev | alpha | beta | RC)
- '[[ -z $STABILITY ]] || composer config minimum-stability "$STABILITY"'
install:
- php -r "echo ini_get('memory_limit').PHP_EOL;"
# Install or update Composer packages including dev dependencies listed in require-dev.
- if [ "$BIURAD_CONSOLE" == yes ]; then php rade ; else travis_retry composer $ACTION ; fi
# Install the coding stardand checker
- composer require squizlabs/php_codesniffer --dev
script:
# This checks that the source code follows the PSR-12 coding Syntax rules.
- ./vendor/bin/phpcs
# Run tests to make sure, we get everything working.
- ./vendor/bin/phpunit
# Fail CI if the repo is in a dirty state after building assets (only for current release ie install).
#- if [[ "$ACTION" == "install" ]]; then yarn install && yarn encore production && git add --all && git diff --staged --exit-code; fi
- composer validate --strict