Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04dd1a2

Browse files
Speedup psalm
1 parent 87aeb8d commit 04dd1a2

File tree

4 files changed

+9
-57
lines changed

4 files changed

+9
-57
lines changed
File renamed without changes.
File renamed without changes.

.github/workflows/psalm.yml

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -19,79 +19,31 @@ jobs:
1919

2020
- name: Checkout PR
2121
uses: actions/checkout@v2
22-
with:
23-
path: pr
24-
25-
- name: Checkout base
26-
uses: actions/checkout@v2
27-
with:
28-
ref: ${{ github.base_ref }}
29-
path: base
3022

3123
- name: Configure composer
3224
run: |
33-
cd base
3425
COMPOSER_HOME="$(composer config home)"
3526
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
3627
echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
3728
38-
- name: Determine composer cache directory
39-
id: composer-cache
40-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
41-
42-
- name: Cache composer dependencies
43-
uses: actions/cache@v2
44-
with:
45-
path: ${{ steps.composer-cache.outputs.dir }}
46-
key: composer-${{ github.base_ref }}
47-
restore-keys: composer-
48-
4929
- name: Install Psalm
5030
run: |
51-
composer require psalm/phar
52-
cp ./vendor/bin/psalm.phar base/psalm.phar
53-
cp ./vendor/bin/psalm.phar pr/psalm.phar
54-
55-
- name: Install dependencies for base
56-
run: |
57-
cd base
5831
echo "::group::modify composer.json"
59-
composer remove symfony/phpunit-bridge --no-interaction --no-update
60-
composer require --no-update phpunit/phpunit php-http/discovery psr/event-dispatcher
32+
composer remove --no-update --no-interaction symfony/phpunit-bridge
33+
composer require --no-update psalm/phar phpunit/phpunit php-http/discovery psr/event-dispatcher
6134
echo "::endgroup::"
6235
echo "::group::composer update"
6336
composer update --no-progress --ansi
37+
git checkout composer.json
6438
echo "::endgroup::"
6539
6640
- name: Generate Psalm baseline
6741
run: |
68-
cd base
69-
./psalm.phar --set-baseline=.github/psalm/psalm.baseline.xml --no-progress
70-
71-
- name: Copy baseline
72-
run: |
73-
cp base/.github/psalm/psalm.baseline.xml pr/.github/psalm/psalm.baseline.xml
74-
75-
- name: Install dependencies for PR
76-
run: |
77-
cd pr
78-
echo "::group::modify composer.json"
79-
composer remove symfony/phpunit-bridge --no-interaction --no-update
80-
composer require --no-update phpunit/phpunit php-http/discovery psr/event-dispatcher
81-
echo "::endgroup::"
82-
echo "::group::composer update"
83-
composer update --no-progress --ansi
84-
echo "::endgroup::"
85-
86-
- name: Cache Psalm
87-
uses: actions/cache@v2
88-
with:
89-
path: pr/.github/psalm/cache/
90-
key: psalm-${{ github.base_ref }}
91-
restore-keys: psalm-
42+
git checkout $(git merge-base --fork-point HEAD^)
43+
./vendor/bin/psalm.phar --set-baseline=.github/psalm/baseline.xml --no-progress
44+
git checkout -m $GITHUB_REF
9245
9346
- name: Psalm
9447
run: |
95-
cd pr
96-
./psalm.phar --version
97-
./psalm.phar --output-format=github --no-progress
48+
./vendor/bin/psalm.phar --version
49+
./vendor/bin/psalm.phar --output-format=github --no-progress

psalm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
88
cacheDirectory="./.github/psalm/cache/"
9-
errorBaseline=".github/psalm/psalm.baseline.xml"
9+
errorBaseline=".github/psalm/baseline.xml"
1010
>
1111
<projectFiles>
1212
<directory name="src" />

0 commit comments

Comments
 (0)