Skip to content

Commit 57dfede

Browse files
authored
Install clang-format via GHA action instead of via NPM (#344)
* Install LLVM / clang-format on CI * Prevent NPM from installing "clang-format"
1 parent e11fcab commit 57dfede

File tree

4 files changed

+40
-21
lines changed

4 files changed

+40
-21
lines changed

.github/workflows/check.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
- uses: actions/setup-node@v6
2929
with:
3030
node-version: lts/krypton
31+
- name: Setup clang-format
32+
uses: aminya/setup-cpp@v1
33+
with:
34+
clang-format: true
3135
# Set up JDK and Android SDK only because we need weak-node-api, to build ferric-example and to run the linting
3236
# TODO: Remove this once we have a way to run linting without building the native code
3337
- name: Set up JDK 17
@@ -67,6 +71,10 @@ jobs:
6771
- uses: actions/setup-node@v6
6872
with:
6973
node-version: lts/krypton
74+
- name: Setup clang-format
75+
uses: aminya/setup-cpp@v1
76+
with:
77+
clang-format: true
7078
- name: Set up JDK 17
7179
uses: actions/setup-java@v4
7280
with:
@@ -96,6 +104,10 @@ jobs:
96104
- uses: actions/setup-node@v6
97105
with:
98106
node-version: lts/krypton
107+
- name: Setup clang-format
108+
uses: aminya/setup-cpp@v1
109+
with:
110+
clang-format: true
99111
- run: npm ci
100112
- run: npm run build
101113
- name: Prepare weak-node-api
@@ -115,6 +127,10 @@ jobs:
115127
- uses: actions/setup-node@v6
116128
with:
117129
node-version: lts/krypton
130+
- name: Setup clang-format
131+
uses: aminya/setup-cpp@v1
132+
with:
133+
clang-format: true
118134
- name: Set up JDK 17
119135
uses: actions/setup-java@v3
120136
with:
@@ -148,6 +164,10 @@ jobs:
148164
- uses: actions/setup-node@v6
149165
with:
150166
node-version: lts/krypton
167+
- name: Setup clang-format
168+
uses: aminya/setup-cpp@v1
169+
with:
170+
clang-format: true
151171
- name: Set up JDK 17
152172
uses: actions/setup-java@v3
153173
with:
@@ -179,6 +199,10 @@ jobs:
179199
- uses: actions/setup-node@v6
180200
with:
181201
node-version: lts/krypton
202+
- name: Setup clang-format
203+
uses: aminya/setup-cpp@v1
204+
with:
205+
clang-format: true
182206
- name: Set up JDK 17
183207
uses: actions/setup-java@v4
184208
with:
@@ -259,6 +283,10 @@ jobs:
259283
- uses: actions/setup-node@v6
260284
with:
261285
node-version: lts/krypton
286+
- name: Setup clang-format
287+
uses: aminya/setup-cpp@v1
288+
with:
289+
clang-format: true
262290
- name: Set up JDK 17
263291
uses: actions/setup-java@v3
264292
with:

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
- uses: actions/setup-node@v6
2222
with:
2323
node-version: lts/krypton
24+
- name: Setup clang-format
25+
uses: aminya/setup-cpp@v1
26+
with:
27+
clang-format: true
2428
- name: Set up JDK 17
2529
uses: actions/setup-java@v3
2630
with:

package-lock.json

Lines changed: 5 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"typescript": "^5.8.0",
7777
"typescript-eslint": "^8.38.0"
7878
},
79+
"overrides": {
80+
"clang-format": "npm:dry-uninstall"
81+
},
7982
"devEngines": {
8083
"runtime": {
8184
"name": "node",

0 commit comments

Comments
 (0)