Skip to content

Commit

Permalink
Build tools caching improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Oct 29, 2020
1 parent 07e4e5e commit 24454b5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ jobs:
- name: "Install PHP dependencies"
run: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable"

- name: "Cache Codesniffer data"
- name: "Cache PHP_CodeSniffer data"
uses: "actions/cache@v2"
with:
path: "var/build-tools/codesniffer.dat"
path: "var/build-tools/PHP_CodeSniffer"
key: "${{ runner.os }}-codesniffer"
restore-keys: "${{ runner.os }}-codesniffer"

Expand Down Expand Up @@ -234,6 +234,13 @@ jobs:
- name: "Install PHP dependencies"
run: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable ${{ matrix.composer-flags }}"

- name: "Cache PHPUnit data"
uses: "actions/cache@v2"
with:
path: "var/build-tools/PHPUnit"
key: "${{ runner.os }}-phpunit"
restore-keys: "${{ runner.os }}-phpunit"

- name: "Setup problem matchers for PHPUnit"
run: 'echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"'

Expand Down Expand Up @@ -329,6 +336,13 @@ jobs:
if: "${{ steps.should-run.outputs.result == 'yes' }}"
run: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable"

- name: "Cache PHPUnit data"
uses: "actions/cache@v2"
with:
path: "var/build-tools/PHPUnit"
key: "${{ runner.os }}-phpunit"
restore-keys: "${{ runner.os }}-phpunit"

- name: "Setup problem matchers for PHPUnit"
if: "${{ steps.should-run.outputs.result == 'yes' }}"
run: 'echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"'
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ all:
qa: cs phpstan ## Check code quality - coding style and static analysis

cs: ## Check PHP files coding style
mkdir -p var/build-tools
mkdir -p var/build-tools/PHP_CodeSniffer
"vendor/bin/phpcs" src tests --standard=build/phpcs.xml $(ARGS)

csf: ## Fix PHP files coding style
mkdir -p var/build-tools
mkdir -p var/build-tools/PHP_CodeSniffer
"vendor/bin/phpcbf" src tests --standard=build/phpcs.xml $(ARGS)

phpstan: ## Analyse code with PHPStan
Expand Down
2 changes: 1 addition & 1 deletion build/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<arg name="basepath" value="./.."/>

<!-- Configure cache -->
<arg name="cache" value="./../var/build-tools/codesniffer.dat"/>
<arg name="cache" value="./../var/build-tools/PHP_CodeSniffer/cache.dat"/>

<!-- Import coding-standard -->
<rule ref="./../vendor/orisai/coding-standard/src/ruleset-7.4.xml"/>
Expand Down
4 changes: 2 additions & 2 deletions build/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xsi:noNamespaceSchemaLocation="./../vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
cacheResultFile="../var/build-tools/.phpunit.result.cache"
cacheResultFile="../var/build-tools/PHPUnit/results.dat"
colors="true"
failOnRisky="true"
failOnWarning="true"
Expand All @@ -13,7 +13,7 @@
<directory>../tests</directory>
</testsuite>

<coverage processUncoveredFiles="true">
<coverage cacheDirectory="../var/build-tools/PHPUnit/coverage" processUncoveredFiles="true">
<include>
<directory suffix=".php">../src</directory>
</include>
Expand Down

0 comments on commit 24454b5

Please sign in to comment.