Merge branch '6.0'
[GitHub/WoltLab/WCF.git] / .github / workflows / codestyle.yml
CommitLineData
1fac1060
TD
1name: Code Style
2
3on:
4 push:
235ac9ba 5 branches:
235ac9ba 6 - master
1fac1060
TD
7 pull_request:
8
c6d66dfa
TD
9permissions:
10 contents: read
11
1fac1060
TD
12jobs:
13 php:
a9229942 14 name: PHP
1fac1060
TD
15 runs-on: ubuntu-latest
16 steps:
f783efaf 17 - uses: actions/checkout@v4
5792dfe9
TD
18 - name: Setup PHP with tools
19 uses: shivammathur/setup-php@v2
a9229942 20 with:
478afbde 21 php-version: '8.1'
5792dfe9 22 extensions: ctype, dom, exif, gd, gmp, hash, intl, json, libxml, mbstring, opcache, pcre, pdo, pdo_mysql, zlib
c5cd8367
TD
23 tools: cs2pr, phpcs, php-cs-fixer
24 - name: phpcs
25 run: phpcs -n -q --report=checkstyle | cs2pr
5792dfe9 26 - name: php-cs-fixer
982fd44c 27 run: php-cs-fixer fix --dry-run --diff
af9f58ec
TD
28 ts:
29 name: TS Prettier
30 runs-on: ubuntu-latest
31 steps:
f783efaf 32 - uses: actions/checkout@v4
1a0841ca 33 - name: Set up node.js
2786d33f 34 uses: actions/setup-node@v4
1a0841ca 35 with:
94552fb9 36 node-version: "18"
20b6dea2 37 cache: "npm"
af9f58ec 38 - run: npm install
fabbea2b
TD
39 - name: Run prettier
40 run: |
af9f58ec 41 shopt -s globstar
83713d5f 42 npx prettier -w ts/**/*.ts
af9f58ec 43 - run: echo "::add-matcher::.github/diff.json"
fabbea2b
TD
44 - name: Show diff
45 run: |
46 git checkout -- package-lock.json
af9f58ec 47 git diff --exit-code
8a52619a
TD
48 scss:
49 name: SCSS Prettier
50 runs-on: ubuntu-latest
51 steps:
f783efaf 52 - uses: actions/checkout@v4
1a0841ca 53 - name: Set up node.js
2786d33f 54 uses: actions/setup-node@v4
1a0841ca 55 with:
94552fb9 56 node-version: "18"
20b6dea2 57 cache: "npm"
8a52619a
TD
58 - run: npm install
59 - name: Run prettier
60 run: |
61 shopt -s globstar
62 npx prettier -w wcfsetup/install/files/style/**/*.scss
b36c0510 63 npx prettier -w wcfsetup/install/files/acp/style/**/*.scss
8a52619a
TD
64 - run: echo "::add-matcher::.github/diff.json"
65 - name: Show diff
66 run: |
67 git checkout -- package-lock.json
68 git diff --exit-code