1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/.circleci/config.yml

115 lines
3.6 KiB
YAML
Raw Normal View History

# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
version: 2.1
executors:
php-72:
docker:
- image: thecodingmachine/php:7.2-v2-cli
jobs:
install-and-self-analyse:
executor: php-72
steps:
- checkout
- run: date "+%F" > /tmp/cachekey; cat composer.json >> /tmp/cachekey
- restore_cache:
keys:
- composer-v2-{{ checksum "/tmp/cachekey" }}
# fallback to using the latest cache if no exact match is found (See https://circleci.com/docs/2.0/caching/)
- composer-v2-
- run: composer update
- save_cache:
key: composer-v2-{{ checksum "/tmp/cachekey" }}
paths:
- vendor
- run:
name: Static analysis
command: php -dextension=pcntl.so ./psalm --threads=10
- persist_to_workspace:
root: /home/docker/project/
paths:
- .
"Code Style Analysis":
executor: php-72
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:
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/
2019-06-15 15:04:52 +02:00
- 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 --coverage-html build/phpunit/coverage-html
2019-06-15 15:04:52 +02:00
- store_artifacts:
path: build/phpunit/coverage-html
- run:
name: Display link to coverage report
command: |
echo "PHPUnit coverage report 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/phpunit/coverage-html/index.html
2019-06-15 15:04:52 +02:00
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
- 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
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/
workflows:
Welcome:
jobs:
- install-and-self-analyse
2019-06-15 15:04:52 +02:00
- test:
requires:
- install-and-self-analyse
- "Code Style Analysis":
requires:
- install-and-self-analyse
2019-06-15 15:04:52 +02:00
- coverage:
requires:
- test
- "Code Style Analysis"
2019-06-15 15:04:52 +02:00
- phar-build:
requires:
- test
- "Code Style Analysis"
2019-06-15 15:04:52 +02:00
- test-with-real-projects:
requires:
- phar-build