-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (36 loc) · 1.1 KB
/
code-checks.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
name: Code Checks
on: [pull_request]
jobs:
codechecks:
name: PHP_CodeSniffer, JSHint
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Checkout module
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
# No composer, but we need our commandline tool.
tools: none, phpcs
coverage: none
# The checkout action refuses to put it outside, so we have to do it in
# two steps.
- name: Checkout coding standard
uses: actions/checkout@v4
with:
repository: backdrop-ops/phpcs
ref: 1.0.0
path: phpcs
- name: Move standard outside current dir
run: mv phpcs ..
- name: Run CodeSniffer
run: |
phpcs --version
phpcs --standard=../phpcs/Backdrop --report=.github/misc/Github.php -n --basepath=. *
- name: Install and run jshint
if: ${{ always() }}
run: |
sudo npm install --quiet -g jshint
jshint --reporter=.github/misc/reporter.js js