forked from orangehrm/orangehrm
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (55 loc) · 1.78 KB
/
linting.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
name: Lint
on: [ push, pull_request ]
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install node dependencies
run: cd src/client && yarn install
- name: Lint client code
run: cd src/client && yarn lint
- name: Lint installer client code
run: |
cd installer/client
yarn install
yarn lint
- name: Lint Cypress tests
run: cd src/test/functional && yarn install && yarn lint
- name: Install dependencies
run: |
php8.1 -f /usr/bin/composer install -d src
php8.1 -f /usr/bin/composer install -d devTools/core
- name: Check PHP Coding Standards
run: php devTools/core/console.php php-cs-fix --php php8.1
- name: Check files changed
id: git-status
run: |
git status --porcelain
echo "status=$(git status --porcelain)" >> $GITHUB_OUTPUT
- name: Fail if files changed
if: ${{ steps.git-status.outputs.status }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('Files changed with lint fix')
- name: Creating diff
if: ${{ failure() }}
run: |
git status
git diff > ${{ github.sha }}.diff
- name: Generate API doc
run: php devTools/core/console.php generate-open-api-doc --throw
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: diff-${{ github.sha }}
path: ${{ github.sha }}.diff
- name: Upload API doc
uses: actions/upload-artifact@v3
with:
name: API-doc-${{ github.sha }}
path: |
build/index.html
build/orangehrm-v2.json