Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Verify JS Style Guide in CI
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ncs-pl committed Mar 5, 2024
1 parent a06abaa commit df2ca3f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Empty file removed .github/workflows/.keep
Empty file.
42 changes: 42 additions & 0 deletions .github/workflows/js_style.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit df2ca3f

Please sign in to comment.