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:
parent
c4551bd0df
commit
4e3a208ec3
@ -32,6 +32,75 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Static analysis
|
name: Static analysis
|
||||||
command: ./psalm
|
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/
|
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/
|
||||||
workflows:
|
workflows:
|
||||||
@ -41,3 +110,18 @@ workflows:
|
|||||||
- static-analysis:
|
- static-analysis:
|
||||||
requires:
|
requires:
|
||||||
- install
|
- 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
14
bin/test-with-real-projects.sh
Executable 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
0
build/phpunit/.gitkeep
Normal file
14
infection.json.dist
Normal file
14
infection.json.dist
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"timeout": 10,
|
||||||
|
"source": {
|
||||||
|
"directories": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"logs": {
|
||||||
|
"text": "build\/infection.log"
|
||||||
|
},
|
||||||
|
"mutators": {
|
||||||
|
"@default": true
|
||||||
|
}
|
||||||
|
}
|
@ -1,13 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<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"
|
bootstrap="vendor/autoload.php"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
beStrictAboutCoversAnnotation="true"
|
beStrictAboutCoversAnnotation="true"
|
||||||
beStrictAboutOutputDuringTests="true"
|
beStrictAboutOutputDuringTests="true"
|
||||||
beStrictAboutTestsThatDoNotTestAnything="false"
|
beStrictAboutTestsThatDoNotTestAnything="false"
|
||||||
beStrictAboutTodoAnnotatedTests="true"
|
beStrictAboutTodoAnnotatedTests="true"
|
||||||
verbose="true">
|
verbose="true"
|
||||||
|
executionOrder="default"
|
||||||
|
>
|
||||||
<testsuite name="psalm">
|
<testsuite name="psalm">
|
||||||
<directory>tests</directory>
|
<directory>tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
Loading…
Reference in New Issue
Block a user