Skip to content

Commit

Permalink
ci(GitHub Actions): update configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
leon0399 committed Nov 24, 2021
1 parent 709e9b0 commit 657eed8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP-CS-Fixer
name: Coding Standards

on:
push:
Expand All @@ -22,6 +22,19 @@ jobs:
php-version: 7.4
coverage: none

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

- name: Cache dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: composer-${{ runner.os }}-${{ hashFiles('composer.json') }}
restore-keys: |
composer-${{ runner.os }}-
composer-
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-plugins --no-scripts

Expand All @@ -30,4 +43,4 @@ jobs:

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: composer php-cs-fixer
commit_message: 'style: php-cs-fixer'
24 changes: 16 additions & 8 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: PHPUnit tests
name: Tests / PHPUnit

on:
push:
pull_request:
push:
branches:
- main
- develop
release:
types:
- published
- release/**

jobs:
php-tests:
Expand Down Expand Up @@ -38,7 +37,7 @@ jobs:
coverage: xdebug
dotenv: ^5.2

name: '[P${{ matrix.php }}] [L${{ matrix.laravel }} (${{ matrix.stability }})] [${{ matrix.coverage }}]'
name: '[PHP ${{ matrix.php }}] [Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}] [${{ matrix.coverage }} coverage]'

steps:
- name: Checkout code
Expand All @@ -52,6 +51,11 @@ jobs:
coverage: ${{ matrix.coverage }}
ini-values: memory_limit=-1

- name: Setup Problem Matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
Expand All @@ -69,8 +73,12 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}"
key: composer-${{ runner.os }}-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('composer.json') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php }}-${{ matrix.laravel }}
composer-${{ runner.os }}-${{ matrix.php }}-
composer-${{ runner.os }}-
composer-
- name: Install dependencies
run: composer update --no-progress --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
Expand Down

0 comments on commit 657eed8

Please sign in to comment.