Compare commits
1
Commits
507ac2cb75
...
b24a5e8a92
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b24a5e8a92 |
@@ -0,0 +1,59 @@
|
|||||||
|
name: ProxmoxAAS-Dashboard Code Style Check
|
||||||
|
run-name: Code style check on ${{gitea.repository}} ${{gitea.ref_name}} ${{gitea.sha}}
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Initialize ${{runner.os}} ${{runner.arch}}
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
|
||||||
|
- name: Install linters
|
||||||
|
run: |
|
||||||
|
npm install --no-save \
|
||||||
|
@eslint/eslintrc \
|
||||||
|
@eslint/js \
|
||||||
|
eslint \
|
||||||
|
globals \
|
||||||
|
html-validate \
|
||||||
|
stylelint \
|
||||||
|
stylelint-config-standard
|
||||||
|
|
||||||
|
- name: Verify linters
|
||||||
|
run: |
|
||||||
|
eslint --version
|
||||||
|
stylelint --version
|
||||||
|
html-validate --version
|
||||||
|
|
||||||
|
- name: Check out ${{gitea.repository}} ${{gitea.ref}} ${{gitea.sha}}
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run HTML Validate
|
||||||
|
id: html_lint
|
||||||
|
run: html-validate --config dev_config/.htmlvalidate.json "web/html/**/*"
|
||||||
|
|
||||||
|
- name: Run Stylelint
|
||||||
|
id: style_lint
|
||||||
|
if: always()
|
||||||
|
run: stylelint --config dev_config/.stylelintrc.json --formatter verbose --fix "web/css/**/*.css"
|
||||||
|
|
||||||
|
- name: Run ESLint
|
||||||
|
id: js_lint
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
DEBUG: eslint:cli-engine
|
||||||
|
run: eslint --config dev_config/eslint.config.mjs --fix web/scripts/
|
||||||
|
|
||||||
|
- name: Verify All Linters Passed
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ "${{ steps.html_lint.outcome }}" != "success" ] || \
|
||||||
|
[ "${{ steps.style_lint.outcome }}" != "success" ] || \
|
||||||
|
[ "${{ steps.js_lint.outcome }}" != "success" ]; then
|
||||||
|
echo "At least one linter failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user