TASK: Add hashing based on composer.json #1377
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
lint: | |
name: Lint PHP | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
coverage: none | |
- name: Install overtrue/phplint | |
run: composer global require "overtrue/phplint:^2.0" --no-ansi --no-interaction --no-progress --classmap-authoritative | |
- name: Run overtrue/phplint | |
run: phplint ./ | |
unittests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: ['7.4', '8.0', '8.1', '8.2'] | |
name: PHP ${{ matrix.php }} unittests | |
steps: | |
- uses: actions/checkout@v3 | |
- id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none # disable xdebug, pcov | |
- run: composer update --no-interaction --no-suggest --no-progress | |
- run: vendor/bin/phpunit |