summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Paul <n@nc0.fr>2024-03-05 11:18:55 +0100
committerNicolas Paul <n@nc0.fr>2024-03-05 11:18:55 +0100
commitdf2ca3fe335db02d60b50246145eb279d8ef8fb9 (patch)
treeb6053fa253a3f1483686ece99cf3b4a2a95cd0ec
parenta06abaae4e121779977345721f0f08e3c0d2d394 (diff)
Verify JS Style Guide in CI
This patch adds a GitHub Actions workflows that ensures the JavaScript source are following our JS Style Guide (Google's one). Signed-off-by: Nicolas Paul <n@nc0.fr>
-rw-r--r--.github/workflows/.keep0
-rw-r--r--.github/workflows/js_style.yml42
2 files changed, 42 insertions, 0 deletions
diff --git a/.github/workflows/.keep b/.github/workflows/.keep
deleted file mode 100644
index e69de29..0000000
--- a/.github/workflows/.keep
+++ /dev/null
diff --git a/.github/workflows/js_style.yml b/.github/workflows/js_style.yml
new file mode 100644
index 0000000..6e74bcf
--- /dev/null
+++ b/.github/workflows/js_style.yml
@@ -0,0 +1,42 @@
+name: JavaScript Style Guide
+on:
+ push:
+ paths: ["*.js", "*.cjs", ".github/workflows/js_style.yml"]
+ pull_request:
+ paths: ["*.js", "*.cjs", ".github/workflows/js_style.yml"]
+env:
+ CI: true
+ NODE_VERSION: 20
+jobs:
+ clangFormat:
+ name: Clang-Format
+ runs-on: ubuntu-latest
+ timeout-minutes: 2
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Set up Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+ cache: "npm"
+ - name: Install Clang-Format
+ run: sudo apt-get install clang-format
+ - name: Run Clang-Format
+ run: npm run fmt
+ eslint:
+ name: ESLint
+ runs-on: ubuntu-latest
+ timeout-minutes: 3
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Set up Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+ cache: "npm"
+ - name: Install dependencies
+ run: npm ci
+ - name: Run ESLint
+ run: npm run lint