This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (43 loc) · 1.64 KB
/
coding-standard.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
46
47
48
49
50
51
52
53
54
55
56
name: "Coding Standard"
on:
push:
paths:
- "**.php"
pull_request:
paths:
- "**.php"
jobs:
php-cs-fixer:
name: "PHP-CS-Fixer"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: "Setup PHP"
uses: shivammathur/setup-php@1.8.2
with:
php-version: "7.4"
tools: composer, cs2pr, pecl
- name: "Configure Container"
env:
NARROWSPARK_EMAIL: ${{ secrets.NARROWSPARK_EMAIL }}
NARROWSPARK_USERNAME: ${{ secrets.NARROWSPARK_USERNAME }}
run: |
echo "::set-env name=COMPOSER_UP::composer update --no-progress --no-suggest --no-interaction --prefer-source --ansi"
EMAIL=${NARROWSPARK_EMAIL:-"d.bannert@anolilab.de"}
NAME=${NARROWSPARK_USERNAME:-"prisis"}
git config --global user.email "${EMAIL}"
git config --global user.name "${NAME}"
- name: "Check PHP Version"
run: php -v
- name: "Check Composer Version"
run: composer -V
- name: "List all php extensions with versions"
run: php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;'
- name: "Install Narrowspark coding standard"
run: composer global require narrowspark/coding-standard:3.4.0 --no-interaction --no-progress --profile --no-suggest --optimize-autoloader
- name: "lint php code"
run: |
cd $GITHUB_WORKSPACE
/home/runner/.composer/vendor/bin/php-cs-fixer fix --config=$GITHUB_WORKSPACE/.php_cs -v --dry-run --format=checkstyle | cs2pr