This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 130
82 lines (68 loc) · 2.45 KB
/
coding-standards.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: "Coding Standards"
on: [push]
jobs:
coding-standards:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.1"
node-version:
- 16
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: "Install Node"
uses: actions/setup-node@v1
with:
node-version: "${{ matrix.node-version }}"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: "Install locked dependencies with npm"
run: "npm ci --ignore-scripts"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install locked dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"
- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: mkdir -p .build/php-cs-fixer
- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/cache@v2"
with:
path: "~/.build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"
- name: "Run eslint"
run: "npm run eslint"
- name: "Run friendsofphp/php-cs-fixer"
run: "composer php-cs-fixer"
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling