-
Notifications
You must be signed in to change notification settings - Fork 19
83 lines (67 loc) · 2.36 KB
/
Copy pathcoding-standards.yml
File metadata and controls
83 lines (67 loc) · 2.36 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
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
name: Coding Standards
on:
pull_request:
types: [ opened, reopened, synchronize, labeled ]
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
# Only run this action if a Pull Request contains the label 'run-tests'
check_for_string_in_pull_request_comment:
name: Should workflow run?
runs-on: ubuntu-latest
steps:
- if: ${{ github.event_name == 'pull_request' && ! contains(github.event.pull_request.labels.*.name, 'run-tests') }}
uses: action-pack/cancel@v1
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer, cs2pr
- name: Log debug information
run: |
php --version
composer --version
- name: Add auth details for private composer packages
run: composer config http-basic.composer.gravity.io ${{ secrets.GF_LICENSE }} http://localhost
- name: Install Composer dependencies
run: |
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction --no-scripts
echo "${PWD}/vendor/bin" >> $GITHUB_PATH
- name: Log PHPCS debug information
run: composer run phpcs:lint .
- name: Run PHP compatibility tests
run: composer run phpcs:compatibility .
jshint:
name: JavaScript coding standards
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node JS
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Log debug information
run: |
npm --version
yarn --version
node --version
curl --version
git --version
locale -a
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run ESLint
run: yarn lint:js
- name: Run CSS Lint
run: yarn lint:css