Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkingshott committed May 5, 2020
1 parent c59881e commit ce4ebbd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 41 deletions.
5 changes: 4 additions & 1 deletion .php_cs → .github/.php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $finder = Symfony\Component\Finder\Finder::create()
->notPath('storage/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->in([__DIR__ . '/src', __DIR__ . '/tests'])
->in([__DIR__ . '/../src', __DIR__ . '/../tests'])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
Expand Down Expand Up @@ -35,5 +35,8 @@ return PhpCsFixer\Config::create()
'keep_multiple_spaces_after_comma' => true,
],
'no_superfluous_phpdoc_tags' => true,
'function_declaration' => [
'closure_function_spacing' => 'none',
],
])
->setFinder($finder);
43 changes: 21 additions & 22 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
# Credit to spatie.be - you guys are legends!
name: styling

on: [push, pull_request]
on: [push]

jobs:
style:
runs-on: ubuntu-latest
style:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Fix style
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs --allow-risky=yes
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.github/.php_cs --allow-risky=yes

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Commit changes
uses: stefanzweifel/[email protected]
with:
commit_message: Fix styling
branch: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes
uses: stefanzweifel/[email protected]
with:
commit_message: Fix styling
branch: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 5 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Credit to spatie.be - you guys are legends!
name: tests

on: [push, pull_request]

jobs:
test:
phpunit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
Expand All @@ -19,21 +18,11 @@ jobs:

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: testing
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
Expand All @@ -46,12 +35,10 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
- name: Run composer
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
- name: Run tests
run: vendor/bin/phpunit

0 comments on commit ce4ebbd

Please sign in to comment.