Browse Source

CI: Add GH Super Linter for a subset of secondary files (#752)

This runs GitHub Super Linter for JSON, XML, and YAML. It also runs a basic JavaScript check and PowerShell lint (for any future .ps1 files).

Bash, CSS, Docker, a better JavaScript check, Markdown, and Perl are included as disabled to be enabled later.

A readme with doc for running the checks locally is included.
Vaclav Petras 4 years ago
parent
commit
c990654201
2 changed files with 46 additions and 0 deletions
  1. 12 0
      .github/workflows/README.md
  2. 34 0
      .github/workflows/super-linter.yml

+ 12 - 0
.github/workflows/README.md

@@ -0,0 +1,12 @@
+# GitHub Actions Workflows
+
+## GitHub Super Linter
+
+Run locally using Docker:
+
+```
+docker run --rm -e RUN_LOCAL=true -e VALIDATE_PERL=true -v $PWD:/tmp/lint github/super-linter
+```
+
+Note that you need to enable each validation separately or not specify
+any to enable all.

+ 34 - 0
.github/workflows/super-linter.yml

@@ -0,0 +1,34 @@
+name: General linting
+
+on:
+- push
+- pull_request
+
+jobs:
+
+  super-linter:
+
+    name: GitHub Super Linter
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    -  name: Lint code base
+       uses: docker://github/super-linter:v2.2.2
+       env:
+         # Listed but disabled linters would be nice to have.
+         # Python (supported using Pylint) and C/C++ (not supported) are
+         # handled separately due to the complexity of the settings.
+         # (The rest is simply disabled automatically as of v2.)
+         VALIDATE_BASH: false
+         VALIDATE_CSS: false
+         VALIDATE_DOCKER: false
+         VALIDATE_JAVASCRIPT_ES: true
+         VALIDATE_JAVASCRIPT_STANDARD: false
+         VALIDATE_JSON: true
+         VALIDATE_MD: false
+         VALIDATE_PERL: false
+         VALIDATE_POWERSHELL: true
+         VALIDATE_XML: true
+         VALIDATE_YAML: true