2019-06-16 00:08:18 +02:00
|
|
|
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
|
|
|
|
version: 2.1
|
|
|
|
executors:
|
2020-08-30 17:44:14 +02:00
|
|
|
php-73:
|
2019-06-16 00:08:18 +02:00
|
|
|
docker:
|
2020-08-30 17:44:14 +02:00
|
|
|
- image: thecodingmachine/php:7.3-v2-cli
|
2020-01-01 19:55:33 +01:00
|
|
|
php-74:
|
|
|
|
docker:
|
|
|
|
- image: thecodingmachine/php:7.4-v3-cli
|
2019-06-16 00:08:18 +02:00
|
|
|
jobs:
|
2019-06-17 22:42:47 +02:00
|
|
|
install-and-self-analyse:
|
2020-08-30 17:44:14 +02:00
|
|
|
executor: php-73
|
2019-06-16 00:08:18 +02:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: date "+%F" > /tmp/cachekey; cat composer.json >> /tmp/cachekey
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-08-23 16:32:07 +02:00
|
|
|
- composer-v3
|
2020-01-25 16:50:11 +01:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- psalm-cache-{{ checksum "/tmp/cachekey" }} # speeds up run with --diff and --diff-methods
|
2019-06-16 00:08:18 +02:00
|
|
|
- run: composer update
|
2020-08-23 16:32:07 +02:00
|
|
|
|
2019-06-16 00:08:18 +02:00
|
|
|
- save_cache:
|
2020-08-23 16:32:07 +02:00
|
|
|
key: composer-v3
|
2019-06-16 00:08:18 +02:00
|
|
|
paths:
|
2020-08-23 16:32:07 +02:00
|
|
|
- /home/docker/.composer/cache/files
|
|
|
|
- /home/docker/.composer/cache/vcs
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Static analysis
|
|
|
|
command: php -dextension=pcntl.so ./psalm --threads=10 --diff --diff-methods
|
|
|
|
|
2020-01-25 16:50:11 +01:00
|
|
|
- save_cache:
|
|
|
|
key: psalm-cache-{{ checksum "/tmp/cachekey" }}
|
|
|
|
paths:
|
|
|
|
- /tmp/psalm
|
2020-08-23 16:32:07 +02:00
|
|
|
|
2019-06-16 00:08:18 +02:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: /home/docker/project/
|
|
|
|
paths:
|
|
|
|
- .
|
2019-06-18 03:17:44 +02:00
|
|
|
"Code Style Analysis":
|
2020-08-30 17:44:14 +02:00
|
|
|
executor: php-73
|
2019-06-18 03:17:44 +02:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /home/docker/project/
|
|
|
|
- run:
|
|
|
|
name: Code Style Analysis with PHPCS
|
|
|
|
command: vendor/bin/phpcs
|
2019-06-15 15:04:52 +02:00
|
|
|
test:
|
2020-08-30 17:44:14 +02:00
|
|
|
executor: php-73
|
2019-06-15 15:04:52 +02:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /home/docker/project/
|
|
|
|
- run:
|
|
|
|
name: PHPUnit test
|
2020-08-23 16:32:07 +02:00
|
|
|
command: php vendor/bin/paratest --runner=WrapperRunner --log-junit build/phpunit/phpunit.xml
|
2019-06-15 15:04:52 +02:00
|
|
|
- store_test_results:
|
2019-06-15 23:10:21 +02:00
|
|
|
path: build/
|
2019-06-15 15:04:52 +02:00
|
|
|
- store_artifacts:
|
|
|
|
path: build/phpunit
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: /home/docker/project/
|
|
|
|
paths:
|
|
|
|
- .
|
|
|
|
phar-build:
|
2020-08-30 17:44:14 +02:00
|
|
|
executor: php-73
|
2019-06-15 15:04:52 +02:00
|
|
|
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
|
2019-07-10 21:43:17 +02:00
|
|
|
- run:
|
|
|
|
name: Display link to phar file
|
|
|
|
command: |
|
|
|
|
echo "Phar build available at:"
|
|
|
|
echo https://circleci.com/api/v1.1/project/github/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BUILD_NUM}/artifacts/0/home/docker/project/build/psalm.phar
|
|
|
|
|
2019-06-15 15:04:52 +02:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: /home/docker/project/
|
|
|
|
paths:
|
|
|
|
- build/psalm.phar
|
2019-08-26 06:45:40 +02:00
|
|
|
test-with-real-projects:
|
2020-01-01 19:55:33 +01:00
|
|
|
executor: php-74
|
2019-08-26 06:45:40 +02:00
|
|
|
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
|
2020-04-06 02:25:50 +02:00
|
|
|
command: bin/test-with-real-projects.sh phpunit
|
|
|
|
- run:
|
|
|
|
name: Analyse Collections
|
|
|
|
command: bin/test-with-real-projects.sh collections
|
|
|
|
- run:
|
|
|
|
name: Analyse ProxyManager
|
|
|
|
command: bin/test-with-real-projects.sh proxymanager
|
2020-07-07 23:12:07 +02:00
|
|
|
- run:
|
|
|
|
name: Analyse Psl
|
|
|
|
command: bin/test-with-real-projects.sh psl
|
2019-06-16 00:08:18 +02:00
|
|
|
|
|
|
|
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/
|
|
|
|
workflows:
|
|
|
|
Welcome:
|
|
|
|
jobs:
|
2019-06-17 22:42:47 +02:00
|
|
|
- install-and-self-analyse
|
2019-06-15 15:04:52 +02:00
|
|
|
- test:
|
|
|
|
requires:
|
2019-06-17 22:42:47 +02:00
|
|
|
- install-and-self-analyse
|
2019-06-18 03:17:44 +02:00
|
|
|
- "Code Style Analysis":
|
|
|
|
requires:
|
|
|
|
- install-and-self-analyse
|
2019-06-15 15:04:52 +02:00
|
|
|
- phar-build:
|
|
|
|
requires:
|
|
|
|
- test
|
2019-06-18 03:17:44 +02:00
|
|
|
- "Code Style Analysis"
|
2019-09-14 21:49:01 +02:00
|
|
|
- test-with-real-projects:
|
|
|
|
requires:
|
|
|
|
- phar-build
|