1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Add circleci config file

This commit is contained in:
Barney Laurance 2019-06-15 14:04:52 +01:00 committed by Matthew Brown
parent c4551bd0df
commit 4e3a208ec3
5 changed files with 116 additions and 2 deletions

View File

@ -32,6 +32,75 @@ jobs:
- run:
name: Static analysis
command: ./psalm
test:
executor: php-72
steps:
- attach_workspace:
at: /home/docker/project/
- run:
name: PHPUnit test
command: php vendor/bin/phpunit --log-junit build/phpunit/phpunit.xml
- store_test_results:
path: build/phpunit/phpunit.xml
- store_artifacts:
path: build/phpunit
- persist_to_workspace:
root: /home/docker/project/
paths:
- .
coverage:
executor: php-72
steps:
- attach_workspace:
at: /home/docker/project/
- run:
name: PHPUnit test with coverage
command: php -dextension=pcov.so vendor/bin/phpunit --log-junit build/phpunit/phpunit.xml --coverage-xml build/phpunit/coverage-xml --coverage-html build/phpunit/coverage-html
- store_artifacts:
path: build/phpunit
- persist_to_workspace:
root: /home/docker/project/
paths:
- .
mutation:
executor: php-72
steps:
- attach_workspace:
at: /home/docker/project/
- run:
name: Install infection
command: composer global require infection/infection
- run:
name: Mutation coverage testing
command: php -d memory_limit=4G ~/.composer/vendor/bin/infection --coverage=build/phpunit
phar-build:
executor: php-72
steps:
- attach_workspace:
at: /home/docker/project/
- run:
name: Build Phar file
command: bin/build-phar.sh
- run:
name: Smoke test Phar file
command: build/psalm.phar --version
- store_artifacts:
path: build/psalm.phar
- persist_to_workspace:
root: /home/docker/project/
paths:
- build/psalm.phar
test-with-real-projects:
executor: php-72
steps:
- checkout # used here just for the side effect of loading the github public ssh key so we can clone other stuff
- attach_workspace:
at: /home/docker/project/
- run:
name: Analyse PHPUnit
command: bin/test-with-real-projects.sh
- store_artifacts:
path: build/psalm.phar
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/
workflows:
@ -41,3 +110,18 @@ workflows:
- static-analysis:
requires:
- install
- test:
requires:
- static-analysis
- coverage:
requires:
- test
- mutation:
requires:
- coverage
- phar-build:
requires:
- test
- test-with-real-projects:
requires:
- phar-build

14
bin/test-with-real-projects.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -e
set -x
cd /tmp/
mkdir testing-with-real-projects
cd testing-with-real-projects
git clone git@github.com:sebastianbergmann/phpunit.git
cd phpunit
git checkout 24b6cfcec34c1167 # release 8.2.2
composer install
~/project/build/psalm.phar --config=.psalm/config.xml

0
build/phpunit/.gitkeep Normal file
View File

14
infection.json.dist Normal file
View File

@ -0,0 +1,14 @@
{
"timeout": 10,
"source": {
"directories": [
"src"
]
},
"logs": {
"text": "build\/infection.log"
},
"mutators": {
"@default": true
}
}

View File

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.2/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="false"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
verbose="true"
executionOrder="default"
>
<testsuite name="psalm">
<directory>tests</directory>
</testsuite>