-
Notifications
You must be signed in to change notification settings - Fork 6
95 lines (72 loc) · 2 KB
/
workflow-code-qa.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
83
84
85
86
87
88
89
90
91
92
93
name: Code Quality Check
on:
push:
branches-ignore:
- master
- develop
workflow_dispatch: {}
env:
PHP_VERSION: '8.1'
NODE_VERSION: '18'
jobs:
php-code-sniffer:
runs-on: ubuntu-22.04
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up SSH key
run: |
mkdir -p ~/.ssh/
echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Install Composer Dependencies
run: composer update
- name: Run PHP CodeSniffer
run: composer lint
- name: Save Composer Built cache
uses: actions/cache@v4
with:
path: .
key: composer-build-cache-${{ github.run_number }}
stylelint:
runs-on: ubuntu-22.04
needs: [ php-code-sniffer ]
steps:
- name: Use Composer Built cache
uses: actions/cache@v4
with:
path: .
key: composer-build-cache-${{ github.run_number }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install npm Dependencies
run: npm run install-dev
- name: Run Stylelint
run: npm run lint:style
- name: Save Node Built cache
uses: actions/cache@v4
with:
path: .
key: composer-node-build-cache-${{ github.run_number }}
eslint:
runs-on: ubuntu-22.04
needs: [php-code-sniffer, stylelint]
steps:
- name: Use Node Built cache
uses: actions/cache@v4
with:
path: .
key: composer-node-build-cache-${{ github.run_number }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Run ESLint
run: npm run lint:js