-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (59 loc) · 2.51 KB
/
code-lint.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
name: Code Lint
on:
pull_request:
types: [opened, synchronize, ready_for_review]
workflow_dispatch:
# 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:
jslint:
name: JavaScript coding standards
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.repository == 'blockeraai/blockera' || github.event_name == 'pull_request' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js and install dependencies
uses: ./.github/setup-node
- name: Running the lint:js
run: npm run lint:js
stylelint:
name: CSS coding standards
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.repository == 'blockeraai/blockera' || github.event_name == 'pull_request' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js and install dependencies
uses: ./.github/setup-node
- name: Running the lint:css
run: npm run lint:css
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.repository == 'blockeraai/blockera' || github.event_name == 'pull_request' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup PHP Composer install dependencies
uses: ./.github/setup-php
- name: Make Composer packages available globally
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
- name: Run PHPCS on all Blockera files
id: phpcs-blockera
run: |
pwd
mkdir -p .cache
phpcs --report-full --report-checkstyle=./.cache/phpcs-report.xml --standard=phpcs.xml
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs-blockera.outcome == 'failure' }}
run: cs2pr ./.cache/phpcs-report.xml
- name: Ensure version-controlled files are not modified during the tests
run: git diff --exit-code