-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.62 KB
/
code-style.yml
File metadata and controls
48 lines (39 loc) · 1.62 KB
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
name: Code style
on:
push:
branches: [ master, main, develop ]
pull_request:
branches: [ master, main, develop ]
jobs:
phpcs:
runs-on: ubuntu-latest
name: PHP CodeSniffer (PSR-12)
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: json, sodium, zlib
coverage: none
- name: Cache Composer packages
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-php-8.3-cs-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.3-cs-
- name: Configure Composer OAuth for private GitHub packages
env:
STAGING_DEPENDENCIES_TOKEN: ${{ secrets.STAGING_DEPENDENCIES_TOKEN }}
run: |
if [ -n "$STAGING_DEPENDENCIES_TOKEN" ]; then
composer config --global github-oauth.github.com "$STAGING_DEPENDENCIES_TOKEN"
fi
- name: Use source install for internal packages (avoids Packagist download counter)
run: composer config preferred-install.comfino/php-api-client source
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Run PHP_CodeSniffer
run: vendor/bin/phpcs