Skip to content

Commit

Permalink
Merge pull request #90 from GeoSot/use-action-for-composer-install-du…
Browse files Browse the repository at this point in the history
…ring-tests

Use an action that caches composer dependencies by itself, during tests
  • Loading branch information
frasmage committed Nov 18, 2022
2 parents 9640e66 + be6e81d commit 36d3cd5
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/automated-test.yml
Expand Up @@ -17,24 +17,11 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-version }}${{ matrix.prefer-lowest }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}${{ matrix.prefer-lowest }}-composer-

- name: Install dependencies
run: composer update --prefer-dist ${{ matrix.prefer-lowest }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: "ramsey/composer-install@v2"
with:
composer-options: "--prefer-dist ${{ matrix.prefer-lowest }}"

- name: Run phpunit
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml -v
Expand Down

0 comments on commit 36d3cd5

Please sign in to comment.