Skip to content

Commit

Permalink
Restructure the GitHub Action setup to include automatic code-style-f…
Browse files Browse the repository at this point in the history
…ix (#172)

* Restructure the GitHub Action setup including auto cs-fix

* Use same format for all workflow files

* Add (not activated) GitHub Funding file
  • Loading branch information
GenieTim authored May 4, 2020
1 parent af03e85 commit c47655a
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 74 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These are supported funding model platforms
tidelift: "packagist/cypresslab/gitelephant"
74 changes: 0 additions & 74 deletions .github/workflows/code_checks.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/code_style_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code Style Check

on:
pull_request:
push:
branches:
- master

jobs:
code_style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
- run: composer install --no-progress
# fix code style, automatically
- run: composer fix-cs
# push changes back
# note that this might not work with PRs from forks:
# https://github.com/stefanzweifel/git-auto-commit-action/issues/25
- uses: stefanzweifel/[email protected]
with:
commit_message: Automatic Fix of Code Style
branch: ${{ github.head_ref }}

# check if some unfixable code style issues remain
- run: composer check-cs
19 changes: 19 additions & 0 deletions .github/workflows/static_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Static Tests

on:
pull_request:
push:
branches:
- master

jobs:
static_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
- run: composer install --no-progress
- run: ./vendor/bin/phpstan analyse -c phpstan.neon
52 changes: 52 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Tests

on:
pull_request:
push:
branches:
- master

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- "7.2"
- "7.3"
- "7.4"
symfony:
- 3.*
- 4.*
- 5.*
dependency-version:
# - prefer-lowest
- prefer-stable

name: PHP ${{ matrix.php }} - S ${{ matrix.symfony }} - ${{ matrix.dependency-version }} - tests
steps:
# basically git clone
- uses: actions/checkout@v2

- name: Setup Git
run: |
git --version
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git --version
- name: Setup PHP
# use PHP of specific version
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
coverage: none # disable xdebug, pcov
tools: composer

- name: Install Composer Dependencies
run: |
composer require "symfony/process:${{ matrix.symfony }}" "symfony/filesystem:${{ matrix.symfony }}" "symfony/finder:${{ matrix.symfony }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Run PHPUnit Tests
run: composer tests

0 comments on commit c47655a

Please sign in to comment.