Skip to content
Permalink
Browse files

Speed up CircleCI build (#1805)

* Use multiple threads to speed up psalm self analysis in CicleCi

* Use non-zero exit code when pcntl needed and not loaded

* Merge install and static analysis jobs in CircleCI

Saves about 20 seconds of 'spin up environment' time
  • Loading branch information...
bdsl authored and muglug committed Jun 17, 2019
1 parent 250ef02 commit 5ab5ec261c97bbe50923a16b4d0faf803f65e601
Showing with 8 additions and 15 deletions.
  1. +6 −14 .circleci/config.yml
  2. +2 −1 src/Psalm/Internal/Fork/Pool.php
@@ -5,7 +5,7 @@ executors:
docker:
- image: thecodingmachine/php:7.2-v2-cli
jobs:
install:
install-and-self-analyse:
executor: php-72
steps:
- checkout
@@ -20,18 +20,13 @@ jobs:
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:
- .
static-analysis:
executor: php-72
steps:
- attach_workspace:
at: /home/docker/project/
- run:
name: Static analysis
command: ./psalm
test:
executor: php-72
steps:
@@ -106,13 +101,10 @@ jobs:
workflows:
Welcome:
jobs:
- install
- static-analysis:
requires:
- install
- install-and-self-analyse
- test:
requires:
- static-analysis
- install-and-self-analyse
- coverage:
requires:
- test
@@ -60,10 +60,11 @@ public function __construct(
);
if (!extension_loaded('pcntl')) {
die(
echo(
'The pcntl extension must be loaded in order for Psalm to be able to use multiple processes.'
. PHP_EOL
);
exit(1);
}
if (ini_get('pcre.jit') === '1'

0 comments on commit 5ab5ec2

Please sign in to comment.
You can’t perform that action at this time.