Skip to content

Commit

Permalink
use GitHub Workflow cache
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-netFantom committed Jun 15, 2023
1 parent cbff443 commit d2bdc99
Showing 1 changed file with 45 additions and 27 deletions.
72 changes: 45 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,31 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate --strict

# - name: Cache Composer packages
# id: composer-cache
# uses: actions/cache@v3
# with:
# path: vendor
# key: ${{ runner.os }}-php${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# ${{ runner.os }}-php${{ matrix.php-version }}-

- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-interaction

- name: PHPUnit tests
run: vendor/bin/phpunit
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-php${{ matrix.php-version }}-composer-
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-interaction

- name: PHPUnit tests
run: vendor/bin/phpunit

code-coverage:
name: Code Coverage
Expand All @@ -81,8 +81,17 @@ jobs:
coverage: pcov
tools: phpunit

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php8.2-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-php8.2-composer-
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-interaction --no-dev
run: composer update --prefer-dist --no-progress --no-interaction

- name: PHPUnit coverage
run: phpunit --coverage-clover=coverage.xml --coverage-text --colors
Expand Down Expand Up @@ -111,8 +120,17 @@ jobs:
coverage: none
tools: psalm

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php8.2-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-php8.2-composer-
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-interaction --no-dev
run: composer update --prefer-dist --no-progress --no-interaction

- name: Psalm coverage
run: psalm --shepherd

0 comments on commit d2bdc99

Please sign in to comment.