Merge pull request #11 from alexander-schranz/patch-1 #30
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: PHP | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
php-cs-fixer: | |
name: Run php-cs-fixer | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v1 | |
- name: Install and configure PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.3' | |
- name: Create downloads directory | |
run: mkdir downloads | |
- name: Get downloads path | |
id: php-cs-fixer-dir | |
run: echo "::set-output name=dir::downloads" | |
- name: Get php-cs-fixer path | |
id: php-cs-fixer-path | |
run: echo "::set-output name=path::${{ steps.php-cs-fixer-dir.outputs.dir }}/php-cs-fixer.phar" | |
- name: Cache php-cs-fixer | |
id: php-cs-fixer-cache | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.php-cs-fixer-dir.outputs.dir }} | |
key: php-cs-fixer | |
- name: Download php-cs-fixer | |
if: steps.php-cs-fixer-cache.outputs.cache-hit != 'true' | |
run: curl "https://cs.symfony.com/download/php-cs-fixer-v2.phar" --output ${{ steps.php-cs-fixer-path.outputs.path }} && chmod +x ${{ steps.php-cs-fixer-path.outputs.path }} | |
- name: Run php-cs-fixer | |
run: ./${{ steps.php-cs-fixer-path.outputs.path }} fix --dry-run --diff |