Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 42 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,52 @@ branches:
php:
- 7.0

# Create stages to try to disable xdebug on standard tests and enable it on code coverage one
stages:
- Tests
- Code coverage
- Build and deploy

cache:
directories:
- $HOME/.composer/cache/files

matrix:
fast_finish: true

before_script:
- composer install --no-interaction --prefer-source --dev

script:
- vendor/bin/codecept run
- vendor/bin/phpcs --standard=phpcs.xml
- find {src, app, test} -name "*.php" ! -path '*/NonPHP7.php' -print0 | xargs -0 -n1 -P8 php -l

after_success:
- php vendor/bin/coveralls
jobs:
include:
- stage: Tests
php: 7.0
before_script:
- composer install --no-interaction --prefer-source --dev
script:
- vendor/bin/codecept run
- vendor/bin/phpcs --standard=phpcs.xml
- find {src, app, test} -name "*.php" ! -path '*/NonPHP7.php' -print0 | xargs -0 -n1 -P8 php -l
- stage: Code coverage
php: 7.0
install:
- composer require --dev php-coveralls/php-coveralls
script:
- php vendor/bin/php-coveralls -v
- stage: Build and deploy
php: 7.0
before_install:
#mettre tous ce qui faut pour se connecter au serveur pour envoyer en prod (eval ssh agent envoyer la public key ssh etc)
deploy:
- provider: script
skip_cleanup: true
script: deploy_staging.sh
on:
branch: "develop"
- provider: script
skip_cleanup: true
script: deploy_main.sh
on:
branch: "main"
- provider: script
skip_cleanup: true
script: deploy_production.sh
on:
tags: true
9 changes: 8 additions & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ paths:
output: tests/_output
support: tests/_support
data: tests

coverage:
enabled: true
remote: false
low_limit: 50
high_limit: 90
whitelist:
include:
- src/*
4 changes: 4 additions & 0 deletions coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
coverage=$(vendor/bin/codecept run --coverage | grep -i Classes:)
percentage="$(echo $coverage | cut -d' ' -f3)"
echo $percentage
7 changes: 5 additions & 2 deletions tests/TotoTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
<?php

use TravisTest\Toto;

class TotoTest extends \Codeception\Test\Unit
{

Expand All @@ -14,7 +17,7 @@ protected function _after()
// tests
public function testTitiSuccess()
{
$toto = new \TravisTest\Toto();
$toto = new Toto();

$this->assertTrue($toto->titi());
}
Expand Down
Loading