Skip to content

Commit b0d9b88

Browse files
committed
(r) Use dedicated GitHub Actions workflow for linting
1 parent 4f8b980 commit b0d9b88

File tree

3 files changed

+85
-1
lines changed

3 files changed

+85
-1
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ jobs:
395395
yarn --cwd arduino-ide-extension build
396396
yarn test
397397
yarn --cwd arduino-ide-extension test:slow
398-
yarn --cwd arduino-ide-extension lint
399398
400399
yarn --cwd electron-app rebuild
401400
yarn --cwd electron-app build
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-javascript-task.md
2+
name: Check JavaScript
3+
4+
env:
5+
# See: https://github.com/actions/setup-node/#readme
6+
NODE_VERSION: 18.17
7+
8+
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
9+
on:
10+
create:
11+
push:
12+
paths:
13+
- ".github/workflows/check-javascript.ya?ml"
14+
- "**/.eslintignore"
15+
- "**/.eslintrc*"
16+
- "**/.npmrc"
17+
- "**/package.json"
18+
- "**/package-lock.json"
19+
- "**/yarn.lock"
20+
- "**.jsx?"
21+
pull_request:
22+
paths:
23+
- ".github/workflows/check-javascript.ya?ml"
24+
- "**/.eslintignore"
25+
- "**/.eslintrc*"
26+
- "**/.npmrc"
27+
- "**/package.json"
28+
- "**/package-lock.json"
29+
- "**/yarn.lock"
30+
- "**.jsx?"
31+
workflow_dispatch:
32+
repository_dispatch:
33+
34+
jobs:
35+
run-determination:
36+
runs-on: ubuntu-latest
37+
permissions: {}
38+
outputs:
39+
result: ${{ steps.determination.outputs.result }}
40+
steps:
41+
- name: Determine if the rest of the workflow should run
42+
id: determination
43+
run: |
44+
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
45+
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
46+
if [[
47+
"${{ github.event_name }}" != "create" ||
48+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
49+
]]; then
50+
# Run the other jobs.
51+
RESULT="true"
52+
else
53+
# There is no need to run the other jobs.
54+
RESULT="false"
55+
fi
56+
57+
echo "result=$RESULT" >> $GITHUB_OUTPUT
58+
59+
check:
60+
needs: run-determination
61+
if: needs.run-determination.outputs.result == 'true'
62+
runs-on: ubuntu-latest
63+
permissions:
64+
contents: read
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
70+
- name: Setup Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
cache: yarn
74+
node-version: ${{ env.NODE_VERSION }}
75+
76+
- name: Install npm package dependencies
77+
run: |
78+
yarn install
79+
80+
- name: Lint
81+
run: |
82+
yarn \
83+
--cwd arduino-ide-extension \
84+
lint

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Arduino IDE 2.x
44

55
[![Arduino IDE](https://github.com/arduino/arduino-ide/workflows/Arduino%20IDE/badge.svg)](https://github.com/arduino/arduino-ide/actions?query=workflow%3A%22Arduino+IDE%22)
6+
[![Check JavaScript status](https://github.com/arduino/arduino-ide/actions/workflows/check-javascript.yml/badge.svg)](https://github.com/arduino/arduino-ide/actions/workflows/check-javascript.yml)
67

78
This repository contains the source code of the Arduino IDE 2.x. If you're looking for the old IDE, go to the [repository of the 1.x version](https://github.com/arduino/Arduino).
89

0 commit comments

Comments
 (0)