-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (36 loc) · 1.44 KB
/
php.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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